Skip to content

Commit f855cee

Browse files
committed
[libc][NFC] use __has_builtin instead of checking macros.
1 parent c56b743 commit f855cee

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libc/shared/rpc_util.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,10 @@ template <typename T> class optional {
152152

153153
/// Suspend the thread briefly to assist the thread scheduler during busy loops.
154154
RPC_ATTRS void sleep_briefly() {
155-
#if defined(__NVPTX__) && defined(RPC_TARGET_IS_GPU)
155+
#if __has_builtin(__nvvm_reflect)
156156
if (__nvvm_reflect("__CUDA_ARCH") >= 700)
157157
asm("nanosleep.u32 64;" ::: "memory");
158-
#elif defined(__AMDGPU__) && defined(RPC_TARGET_IS_GPU)
158+
#elif __has_builtin(__builtin_amdgcn_s_sleep)
159159
__builtin_amdgcn_s_sleep(2);
160160
#elif __has_builtin(__builtin_ia32_pause)
161161
__builtin_ia32_pause();

0 commit comments

Comments
 (0)