[PATCH] D17561: [CUDA] Add conversion operators for threadIdx, blockIdx, gridDim, and blockDim to uint3 and dim3.

Artem Belevich via cfe-commits cfe-commits at lists.llvm.org
Wed Feb 24 10:17:59 PST 2016

tra added inline comments.

Comment at: lib/Headers/cuda_builtin_vars.h:72
@@ -66,1 +71,3 @@
+  // uint3).  This function is defined after we pull in vector_types.h.
+  __attribute__((device)) operator uint3() const;
Considering that built-in variables are never instantiated, I wonder how it's going to work as the operator will presumably need 'this' pointing *somewhere*, even if we don't use it. Unused 'this' would probably get optimized away with optimizations on, but -O0 may cause problems.


More information about the cfe-commits mailing list