From 34dc9155abb81620f745b31bc096c5b4c74faf1e Mon Sep 17 00:00:00 2001 From: trivialfis Date: Thu, 2 Aug 2018 18:04:23 +0800 Subject: [PATCH] Use __CUDA__ macro with __NVCC__. (#3539) * __CUDA__ is defined in clang. Making the change won't make clang compile xgboost, but syntax checking from clang is at least partially working. --- include/xgboost/base.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/xgboost/base.h b/include/xgboost/base.h index 3a2a10dbd..97b140294 100644 --- a/include/xgboost/base.h +++ b/include/xgboost/base.h @@ -69,7 +69,7 @@ /*! * \brief Tag function as usable by device */ -#ifdef __NVCC__ +#if defined (__CUDA__) || defined(__NVCC__) #define XGBOOST_DEVICE __host__ __device__ #else #define XGBOOST_DEVICE