llvm-project
e2c2ce2e - [Clang] Fix cluster_dims thread block limit checks (#230186)

Commit
40 days ago
[Clang] Fix cluster_dims thread block limit checks (#230186) The limit is on the total number of thread blocks, 8 for NVPTX and 16 for AMDGPU, but two checks got in the way. A 4-bit cap on each dimension rejected cluster_dims(16, 1, 1) while accepting the same 16 blocks as cluster_dims(4, 4, 1), and an omitted dimension contributed 0 rather than 1, zeroing the product so cluster_dims(15, 15) compiled cleanly. Bound each dimension only enough to keep the product from overflowing and let the existing total size diagnostic enforce the limit. Code that relied on the unenforced limit now fails to compile.
Parents
Loading