From 178a7a5cfa332579163a7d9adc8ec25701689ee6 Mon Sep 17 00:00:00 2001 From: Jeremy Newton Date: Fri, 11 Mar 2022 17:53:45 -0500 Subject: [PATCH] Drop some unnecessary definitions __x86_64__ and __AMD64__ should be already defined by the compiler to specify the compilation target and shouldn't be defined manually. I fixed two x86_64 checks to include VS variables, as removing this might cause it to fail to compile on that compiler. Signed-off-by: Jeremy Newton Change-Id: I600ff449af85bf7d83ecab167d97933922e2d917 --- runtime/hsa-runtime/CMakeLists.txt | 2 -- runtime/hsa-runtime/core/util/atomic_helpers.h | 2 +- runtime/hsa-runtime/core/util/timer.h | 2 +- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/runtime/hsa-runtime/CMakeLists.txt b/runtime/hsa-runtime/CMakeLists.txt index a53d50ab2c..0eb5dea55b 100644 --- a/runtime/hsa-runtime/CMakeLists.txt +++ b/runtime/hsa-runtime/CMakeLists.txt @@ -205,8 +205,6 @@ if(${IMAGE_SUPPORT}) HSA_IMAGE_SUPPORT UNIX_OS LINUX - __AMD64__ - __x86_64__ AMD_INTERNAL_BUILD BRAHMA_BUILD=1 ) diff --git a/runtime/hsa-runtime/core/util/atomic_helpers.h b/runtime/hsa-runtime/core/util/atomic_helpers.h index 8844dc41dd..89cef6a638 100644 --- a/runtime/hsa-runtime/core/util/atomic_helpers.h +++ b/runtime/hsa-runtime/core/util/atomic_helpers.h @@ -56,7 +56,7 @@ #define ALWAYS_CONSERVATIVE 0 #if !ALWAYS_CONSERVATIVE -#ifdef __x86_64 +#if defined(__x86_64__) || defined(_M_X64) #define X64_ORDER_WC 1 #endif #if X64_ORDER_WC diff --git a/runtime/hsa-runtime/core/util/timer.h b/runtime/hsa-runtime/core/util/timer.h index 95ae24953a..131362ce11 100644 --- a/runtime/hsa-runtime/core/util/timer.h +++ b/runtime/hsa-runtime/core/util/timer.h @@ -145,7 +145,7 @@ class fast_clock { typedef uint64_t raw_rep; typedef double raw_frequency; -#ifdef __x86_64__ +#if defined(__x86_64__) || defined(_M_X64) static __forceinline raw_rep raw_now() { return __rdtsc(); } static __forceinline raw_frequency raw_freq() { return freq; } #else