From f2e769d6a6cedd15d78530db22c1eafd8e048c01 Mon Sep 17 00:00:00 2001 From: Federico Busato <50413820+fbusato@users.noreply.github.com> Date: Thu, 30 Jan 2025 18:53:16 -0800 Subject: [PATCH] Disable X86-64 detection macro for Arm64 emulation on MSVC (#3540) --- libcudacxx/include/cuda/std/__cccl/architecture.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libcudacxx/include/cuda/std/__cccl/architecture.h b/libcudacxx/include/cuda/std/__cccl/architecture.h index 1c7f25d6b0e..c50fe4fea1c 100644 --- a/libcudacxx/include/cuda/std/__cccl/architecture.h +++ b/libcudacxx/include/cuda/std/__cccl/architecture.h @@ -26,7 +26,9 @@ #endif // X86 64-bit -#if defined(_M_X64) || defined(__amd64__) || defined(__x86_64__) + +// _M_X64 is defined even if we are compiling in Arm64 emulation mode +#if (defined(_M_X64) && !defined(_M_ARM64EC)) || defined(__amd64__) || defined(__x86_64__) # define _CCCL_ARCH_X86_64_() 1 #else # define _CCCL_ARCH_X86_64_() 0