[clang] [HLSL][SPIRV] Allow large z value in numthreads (PR #144934)

Steven Perron via cfe-commits cfe-commits at lists.llvm.org
Fri Jun 20 07:01:56 PDT 2025


================
@@ -1033,12 +1033,15 @@ void SemaHLSL::handleRootSignatureAttr(Decl *D, const ParsedAttr &AL) {
 void SemaHLSL::handleNumThreadsAttr(Decl *D, const ParsedAttr &AL) {
   llvm::VersionTuple SMVersion =
       getASTContext().getTargetInfo().getTriple().getOSVersion();
+  bool IsDXIL = getASTContext().getTargetInfo().getTriple().getArch() ==
+                llvm::Triple::dxil;
+
   uint32_t ZMax = 1024;
----------------
s-perron wrote:

I don't think so. These are close to the limits on actual machines. For Android, the existing checks are way beyond the limit.

See maxComputeWorkGroupInvocations and  maxComputeWorkGroupSize in https://vulkan.lunarg.com/doc/sdk/1.4.313.2/windows/profiles_definitions.html.

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


More information about the cfe-commits mailing list