Skip to content

Commit 43999de

Browse files
[spirv][amdgpu] Set atomic size in the clang target info (#128569)
Problem identified by Joseph. The openmp device runtime uses __scoped_atomic_load_n and similar which presently hit ``` error: large atomic operation may incur significant performance penalty; the access size (4 bytes) exceeds the max lock-free size (0 bytes) [-Werror,-Watomic-alignment] ``` This is because the spirv class doesn't set the corresponding field. The base does, but only if there's a host toolchain, which there isn't.
1 parent 0a7809c commit 43999de

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

clang/lib/Basic/Targets/SPIR.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -399,6 +399,8 @@ class LLVM_LIBRARY_VISIBILITY SPIRV64AMDGCNTargetInfo final
399399
HasLegalHalfType = true;
400400
HasFloat16 = true;
401401
HalfArgsAndReturns = true;
402+
403+
MaxAtomicPromoteWidth = MaxAtomicInlineWidth = 64;
402404
}
403405

404406
bool hasBFloat16Type() const override { return true; }

0 commit comments

Comments
 (0)