[clang] [clang-tools-extra] [CudaSPIRV] Allow using integral non-type template parameters as attribute args (PR #131546)
Alexander Shaposhnikov via cfe-commits
cfe-commits at lists.llvm.org
Mon Mar 17 14:17:37 PDT 2025
================
@@ -8,9 +8,23 @@
__attribute__((reqd_work_group_size(128, 1, 1)))
__global__ void reqd_work_group_size_128_1_1() {}
+template <unsigned a, unsigned b, unsigned c>
+__attribute__((reqd_work_group_size(a, b, c)))
+__global__ void reqd_work_group_size_a_b_c() {}
+
+template <>
+__global__ void reqd_work_group_size_a_b_c<128,1,1>(void);
+
__attribute__((work_group_size_hint(2, 2, 2)))
__global__ void work_group_size_hint_2_2_2() {}
+template <unsigned a, unsigned b, unsigned c>
+__attribute__((work_group_size_hint(a, b, c)))
+__global__ void work_group_size_hint_a_b_c() {}
+
+template <>
+__global__ void work_group_size_hint_a_b_c<128,1,1>(void);
----------------
alexander-shaposhnikov wrote:
Added a new test in clang/test/CodeGenCUDASPIRV/spirv-attrs.cu
https://github.com/llvm/llvm-project/pull/131546
More information about the cfe-commits
mailing list