[clang] [Clang] Default OpenMP and C/C++ compilations to uniform blocks (PR #221279)

Joseph Huber via cfe-commits cfe-commits at lists.llvm.org
Sat Sep 5 08:04:20 PDT 2026


================
@@ -2865,12 +2865,11 @@ void CodeGenModule::ConstructAttributeList(StringRef Name,
                                  NumElemsParam);
     }
 
-    // OpenCL v2.0 Work groups may be whether uniform or not.
-    // '-cl-uniform-work-group-size' compile option gets a hint
-    // to the compiler that the global work-size be a multiple of
-    // the work-group size specified to clEnqueueNDRangeKernel
-    // (i.e. work groups are uniform).
-    if (getLangOpts().OffloadUniformBlock)
+    // Leftover work-groups are an OpenCL 2.0+ language feature. Host C/C++
+    // inherit OffloadUniformBlock but must not receive the GPU ABI attribute.
----------------
jhuber6 wrote:

I genuinely can't think of a clean way to do this without just using the triple. What I had before was "CUDA / HIP / SYCL / OpenMP Device / C / C++ with a  GPU target" and I think that's perfectly reasonable.

https://github.com/llvm/llvm-project/pull/221279


More information about the cfe-commits mailing list