File tree Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Expand file tree Collapse file tree 1 file changed +9
-6
lines changed Original file line number Diff line number Diff line change 1717#define RPC_TARGET_IS_GPU
1818#endif
1919
20+ // Workaround for missing __has_builtin in < GCC 10.
21+ #ifndef __has_builtin
22+ #define __has_builtin (x ) 0
23+ #endif
24+
2025#ifndef RPC_INLINE
2126#define RPC_INLINE inline
2227#endif
@@ -141,17 +146,15 @@ template <typename T> class optional {
141146
142147// / Suspend the thread briefly to assist the thread scheduler during busy loops.
143148RPC_INLINE void sleep_briefly () {
144- #if defined(LIBC_TARGET_ARCH_IS_NVPTX )
149+ #if defined(__NVPTX__ )
145150 if (__nvvm_reflect (" __CUDA_ARCH" ) >= 700 )
146151 asm (" nanosleep.u32 64;" ::: " memory" );
147- #elif defined(LIBC_TARGET_ARCH_IS_AMDGPU )
152+ #elif defined(__AMDGPU__ )
148153 __builtin_amdgcn_s_sleep (2 );
149- #elif defined(LIBC_TARGET_ARCH_IS_X86 )
154+ #elif __has_builtin(__builtin_ia32_pause )
150155 __builtin_ia32_pause ();
151- #elif defined(LIBC_TARGET_ARCH_IS_AARCH64) && __has_builtin(__builtin_arm_isb)
156+ #elif __has_builtin(__builtin_arm_isb)
152157 __builtin_arm_isb (0xf );
153- #elif defined(LIBC_TARGET_ARCH_IS_AARCH64)
154- asm volatile (" isb\n " ::: " memory" );
155158#else
156159 // Simply do nothing if sleeping isn't supported on this platform.
157160#endif
You can’t perform that action at this time.
0 commit comments