================
@@ -199,6 +200,17 @@ static const omp::GV &getGridValue(const Triple &T,
Function *Kernel) {
Kernel->getFnAttribute("target-features").getValueAsString();
if (Features.count("+wavefrontsize64"))
return omp::getAMDGPUGridValues<64>();
+ if (Features.count("+wavefrontsize32"))
+ return omp::getAMDGPUGridValues<32>();
+
+ // Clang sets no wavefront size on OpenMP device kernels, so ask the CPU.
+ StringRef CPU = Kernel->getFnAttribute("target-cpu").getValueAsString();
+ AMDGPU::GPUKind Kind = AMDGPU::parseArchAMDGCN(CPU);
+ if (Kind == AMDGPU::GK_NONE)
+ Kind = AMDGPU::getGPUKindFromSubArch(T.getSubArch());
+ if (Kind != AMDGPU::GK_NONE &&
+ !AMDGPU::getFeatureBitset(Kind).test(AMDGPU::FEAT_SUPPORTS_WAVE32))
+ return omp::getAMDGPUGridValues<64>();
return omp::getAMDGPUGridValues<32>();
----------------
ro-i wrote:
shouldn't this return <64> to avoid running into the same underflow for unkown
GPU kind?
https://github.com/llvm/llvm-project/pull/218790
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits