From 8442259da02bdde5673a6cb20782c208fa085ad1 Mon Sep 17 00:00:00 2001 From: Maneesh Gupta Date: Tue, 9 Feb 2016 10:57:20 +0530 Subject: [PATCH] Move HIP_DEVICE_COMPILE defines to hip_common.h [ROCm/clr commit: f6e7abd7106a0703dd92b0240a8e78ec4c3423fa] --- .../clr/hipamd/include/hcc_detail/hip_runtime.h | 7 ------- projects/clr/hipamd/include/hip_common.h | 16 ++++++++++------ .../clr/hipamd/include/nvcc_detail/hip_runtime.h | 5 ----- 3 files changed, 10 insertions(+), 18 deletions(-) diff --git a/projects/clr/hipamd/include/hcc_detail/hip_runtime.h b/projects/clr/hipamd/include/hcc_detail/hip_runtime.h index a84549ac4f..d7e4cba328 100644 --- a/projects/clr/hipamd/include/hcc_detail/hip_runtime.h +++ b/projects/clr/hipamd/include/hcc_detail/hip_runtime.h @@ -62,9 +62,6 @@ THE SOFTWARE. #if defined(__HCC_ACCELERATOR__) and (__HCC_ACCELERATOR__ != 0) // Device compile and not host compile: - -#define __HIP_DEVICE_COMPILE__ 1 - //TODO-HCC enable __HIP_ARCH_HAS_ATOMICS__ when HCC supports these. // 32-bit Atomics: #define __HIP_ARCH_HAS_GLOBAL_INT32_ATOMICS__ (1) @@ -95,10 +92,6 @@ THE SOFTWARE. #define __HIP_ARCH_HAS_3DGRID__ (1) #define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (0) -#else -// Host compile and not device compile: -#define __HIP_DEVICE_COMPILE__ 0 - #endif diff --git a/projects/clr/hipamd/include/hip_common.h b/projects/clr/hipamd/include/hip_common.h index 0230c36386..d8be2bb928 100644 --- a/projects/clr/hipamd/include/hip_common.h +++ b/projects/clr/hipamd/include/hip_common.h @@ -32,9 +32,11 @@ THE SOFTWARE. #define __HIP_PLATFORM_HCC__ #define __HIPCC__ -# if defined __HCC_ACCELERATOR__ -# define __HIP_DEVICE_COMPILE__ 1 -# endif +#if defined(__HCC_ACCELERATOR__) and (__HCC_ACCELERATOR__ != 0) +#define __HIP_DEVICE_COMPILE__ 1 +#else +#define __HIP_DEVICE_COMPILE__ 0 +#endif #endif // Auto enable __HIP_PLATFORM_NVCC__ if compiling with NVCC @@ -44,9 +46,11 @@ THE SOFTWARE. # define __HIPCC__ # endif -# ifdef __CUDA_ARCH__ -# define __HIP_DEVICE_COMPILE__ 1 -# endif +#if defined(__CUDA_ARCH__) and (__CUDA_ARCH__ != 0) +#define __HIP_DEVICE_COMPILE__ 1 +#else +#define __HIP_DEVICE_COMPILE__ 0 +#endif #endif diff --git a/projects/clr/hipamd/include/nvcc_detail/hip_runtime.h b/projects/clr/hipamd/include/nvcc_detail/hip_runtime.h index 1e9b0d27e6..48f29518c9 100644 --- a/projects/clr/hipamd/include/nvcc_detail/hip_runtime.h +++ b/projects/clr/hipamd/include/nvcc_detail/hip_runtime.h @@ -72,11 +72,6 @@ kernelName<<>>(0, __VA_ARGS__);\ #define __HIP_ARCH_HAS_3DGRID__ (__CUDA_ARCH__ >= 200) #define __HIP_ARCH_HAS_DYNAMIC_PARALLEL__ (__CUDA_ARCH__ >= 350) - -#else - -#define __HIP_DEVICE_COMPILE__ 0 - #endif #ifdef __CUDACC__