Skip to content

[CUDA][BugFix] Guard tensor map enums by toolkit version - #20155

Closed
jinhongyii wants to merge 1 commit into
mainfrom
codex/fix-cuda-tensor-map-enum-guards
Closed

[CUDA][BugFix] Guard tensor map enums by toolkit version#20155
jinhongyii wants to merge 1 commit into
mainfrom
codex/fix-cuda-tensor-map-enum-guards

Conversation

@jinhongyii

Copy link
Copy Markdown
Contributor

CUDA tensor-map enum members are C++ identifiers, not preprocessor macros. The existing #ifdef checks therefore evaluated false even when CUDA 12.8+ cuda.h declared packed tensor-map data types and atomic 128-byte swizzle modes. This caused host validation to reject supported swizzles and to skip their packed/128-byte validation rules.\n\nThis change uses the existing CUDA_VERSION >= 12080 availability contract consistently for every affected dtype and swizzle validation path. Older toolkits still compile without referencing the newer enum members.\n\nTesting:\n- pre-commit run clang-format --files src/backend/cuda/runtime/cuda_device_api.cc\n- CUDA 13 build with USE_NVSHMEM=ON: cmake --build build --parallel 16\n- Downstream TIRx GDN swizzle path: 10 correctness launches and 3 benchmark rounds passed

CUDA tensor-map enum members are identifiers rather than preprocessor macros, so #ifdef silently excluded the CUDA 12.8 packed data types and atomic swizzle modes even when cuda.h declared them. Use CUDA_VERSION consistently for the validation paths that reference those members.
@jinhongyii
jinhongyii force-pushed the codex/fix-cuda-tensor-map-enum-guards branch from fb310e1 to af1f548 Compare August 18, 2026 02:25
@jinhongyii

Copy link
Copy Markdown
Contributor Author

Closing as a duplicate of #20154, which covers every tensor-map enum guard changed here and also carries the registry correctness fixes and direct GDN/full-suite validation.

@jinhongyii jinhongyii closed this Aug 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant