From a03add7a0beb51a5a63a31a3af6ade2e9021040f Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Wed, 21 Sep 2022 20:57:00 -0400 Subject: [PATCH 1/3] Separating _RAFT_HOST and _RAFT_DEVICE macros --- cpp/include/raft/core/detail/macros.hpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/include/raft/core/detail/macros.hpp b/cpp/include/raft/core/detail/macros.hpp index 00fbab1530..4453a02c53 100644 --- a/cpp/include/raft/core/detail/macros.hpp +++ b/cpp/include/raft/core/detail/macros.hpp @@ -24,12 +24,16 @@ #ifndef _RAFT_HOST_DEVICE #if defined(_RAFT_HAS_CUDA) -#define _RAFT_HOST_DEVICE __host__ __device__ +#define _RAFT_DEVICE __device__ +#define _RAFT_HOST __host__ #else -#define _RAFT_HOST_DEVICE +#define _RAFT_DEVICE +#define _RAFT_HOST #endif #endif +#define _RAFT_HOST_DEVICE _RAFT_HOST _RAFT_DEVICE + #ifndef RAFT_INLINE_FUNCTION #define RAFT_INLINE_FUNCTION inline _RAFT_HOST_DEVICE #endif From e35e088c516e64252eb324c564729c3bf9c4a9b0 Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Wed, 21 Sep 2022 20:59:06 -0400 Subject: [PATCH 2/3] Adding _FORCEINLINE --- cpp/include/raft/core/detail/macros.hpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cpp/include/raft/core/detail/macros.hpp b/cpp/include/raft/core/detail/macros.hpp index 4453a02c53..ae499f6769 100644 --- a/cpp/include/raft/core/detail/macros.hpp +++ b/cpp/include/raft/core/detail/macros.hpp @@ -26,14 +26,16 @@ #if defined(_RAFT_HAS_CUDA) #define _RAFT_DEVICE __device__ #define _RAFT_HOST __host__ +#define _RAFT_FORCEINLINE __forceinline__ #else #define _RAFT_DEVICE #define _RAFT_HOST +#define _RAFT_FORCEINLINE inline #endif #endif #define _RAFT_HOST_DEVICE _RAFT_HOST _RAFT_DEVICE #ifndef RAFT_INLINE_FUNCTION -#define RAFT_INLINE_FUNCTION inline _RAFT_HOST_DEVICE +#define RAFT_INLINE_FUNCTION _RAFT_FORCEINLINE _RAFT_HOST_DEVICE #endif From 458558ca3167e2204e7118a61a32a906c930e34f Mon Sep 17 00:00:00 2001 From: "Corey J. Nolet" Date: Wed, 21 Sep 2022 21:17:28 -0400 Subject: [PATCH 3/3] Fixing style --- cpp/include/raft/core/detail/macros.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/cpp/include/raft/core/detail/macros.hpp b/cpp/include/raft/core/detail/macros.hpp index ae499f6769..4b804d61e3 100644 --- a/cpp/include/raft/core/detail/macros.hpp +++ b/cpp/include/raft/core/detail/macros.hpp @@ -24,8 +24,8 @@ #ifndef _RAFT_HOST_DEVICE #if defined(_RAFT_HAS_CUDA) -#define _RAFT_DEVICE __device__ -#define _RAFT_HOST __host__ +#define _RAFT_DEVICE __device__ +#define _RAFT_HOST __host__ #define _RAFT_FORCEINLINE __forceinline__ #else #define _RAFT_DEVICE