Conversation
There was a problem hiding this comment.
Pull request overview
This PR optimizes the PTT (Parallel Transport Tractography) direction getter by switching from global device memory to CUDA texture memory for ODF data, which enables hardware-accelerated trilinear interpolation. It also adds caching for FA and CSD ODF computations, and introduces a seed for reproducible seed generation.
Changes:
- Replaced global memory reads with CUDA 3D texture memory lookups for PTT, adding texture allocation/deallocation in the GPU tracker and a new
ptt_init.cukernel for texture-based initial direction finding. - Added a
DATA_Ttemplate parameter togenStreamlinesMergeProb_kandtracker_dto support both raw pointer and texture object data access paths. - Added FA and CSD ODF disk caching (
--cache-dir) and a--seed-seedargument for reproducible seed generation in the run script.
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
run_gpu_streamlines.py |
Added --cache-dir and --seed-seed CLI args; FA/ODF caching logic |
cuslines/cuda_python/cu_tractography.py |
Texture memory allocation/deallocation for PTT; removed unused MEGABYTE import |
cuslines/cuda_python/cu_direction_getters.py |
Updated kernel template names with DATA_T; handle texture objects in launch calls |
cuslines/cuda_c/ptt_init.cu |
New kernel for PTT initial direction finding using texture memory |
cuslines/cuda_c/ptt.cu |
Changed pmf parameter type to cudaTextureObject_t; replaced trilinear interp with tex3D |
cuslines/cuda_c/generate_streamlines_cuda.cu |
Added DATA_T template parameter to tracker_d and genStreamlinesMergeProb_k; included ptt_init.cu |
cuslines/cuda_python/cu_propagate_seeds.py |
Removed a TODO comment |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
This PR aims to speed up PTT (Parallel Transport Tractography) by moving more parameters to compile-time CUDA macros and introducing CUDA texture-memory paths, while also modernizing Python packaging/lint tooling and adding caching to the example runner.
Changes:
- Refactor CUDA kernels + Python launch code to use compile-time macros and texture-backed data/metric maps (notably for PTT).
- Add optional FA/CSD-ODF caching and deterministic seeding controls to
run_gpu_streamlines.py. - Migrate packaging metadata into
pyproject.tomland add Ruff + pre-commit configuration.
Reviewed changes
Copilot reviewed 20 out of 20 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| setup.py | Removed legacy setuptools build hook (previously used for build-time codegen). |
| pyproject.toml | Adds Ruff config, moves URLs/package-data into pyproject, adds scipy + dev extras. |
| .pre-commit-config.yaml | Adds Ruff + codespell hooks. |
| run_gpu_streamlines.py | Reformats imports/args; adds --cache-dir and caching for FA/CSD ODF; adds --seed-seed. |
| cuslines/cuda_python/cutils.py | Adds allocate_texture() helper and runtime imports for texture creation/copies. |
| cuslines/cuda_python/cu_tractography.py | Allocates dataf/metric_map via textures (PTT + stopping map), compiles kernels via direction getter. |
| cuslines/cuda_python/cu_direction_getters.py | Introduces macro-driven compilation and adds PTT direction getter implementation details. |
| cuslines/cuda_python/cu_propagate_seeds.py | Minor import/format cleanup. |
| cuslines/cuda_python/_globals.py | Updates shared constants module content/comments. |
| cuslines/cuda_python/init.py | Reorders exports/imports. |
| cuslines/init.py | Import ordering tweaks for backend-specific classes. |
| cuslines/boot_utils.py | Formatting-only refactor. |
| cuslines/cuda_c/* (multiple) | Kernel signature refactors, macro usage, PTT init kernel added, texture-based stopping checks, and related updates. |
| CLAUDE.md | Updates repository documentation around constants/codegen conventions. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.