We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
__has_builtin
1 parent c56b743 commit f855ceeCopy full SHA for f855cee
libc/shared/rpc_util.h
@@ -152,10 +152,10 @@ template <typename T> class optional {
152
153
/// Suspend the thread briefly to assist the thread scheduler during busy loops.
154
RPC_ATTRS void sleep_briefly() {
155
-#if defined(__NVPTX__) && defined(RPC_TARGET_IS_GPU)
+#if __has_builtin(__nvvm_reflect)
156
if (__nvvm_reflect("__CUDA_ARCH") >= 700)
157
asm("nanosleep.u32 64;" ::: "memory");
158
-#elif defined(__AMDGPU__) && defined(RPC_TARGET_IS_GPU)
+#elif __has_builtin(__builtin_amdgcn_s_sleep)
159
__builtin_amdgcn_s_sleep(2);
160
#elif __has_builtin(__builtin_ia32_pause)
161
__builtin_ia32_pause();
0 commit comments