Skip to content

Commit b2d1534

Browse files
committed
[OpenMP] Build OpenMP DeviceRTL on SPIRV64
Signed-off-by: Sarnie, Nick <[email protected]>
1 parent 432a871 commit b2d1534

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

libc/shared/rpc_util.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ RPC_ATTRS void sleep_briefly() {
157157
asm("nanosleep.u32 64;" ::: "memory");
158158
#elif defined(__AMDGPU__) && defined(RPC_TARGET_IS_GPU)
159159
__builtin_amdgcn_s_sleep(2);
160-
#elif __has_builtin(__builtin_ia32_pause)
160+
#elif __has_builtin(__builtin_ia32_pause) && !defined(__SPIRV__)
161161
__builtin_ia32_pause();
162162
#elif __has_builtin(__builtin_arm_isb)
163163
__builtin_arm_isb(0xf);

offload/DeviceRTL/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -264,6 +264,9 @@ compileDeviceRTLLibrary(amdgpu amdgcn-amd-amdhsa -Xclang -mcode-object-version=n
264264
add_custom_target(omptarget.devicertl.nvptx)
265265
compileDeviceRTLLibrary(nvptx nvptx64-nvidia-cuda --cuda-feature=+ptx63)
266266

267+
add_custom_target(omptarget.devicertl.spirv64)
268+
compileDeviceRTLLibrary(spirv64 spirv64)
269+
267270
# Archive all the object files generated above into a static library
268271
add_library(omptarget.devicertl STATIC)
269272
set_target_properties(omptarget.devicertl PROPERTIES

0 commit comments

Comments
 (0)