Skip to content

Commit

Permalink
Separating _RAFT_HOST and _RAFT_DEVICE macros (#836)
Browse files Browse the repository at this point in the history
Authors:
  - Corey J. Nolet (https://github.com/cjnolet)

Approvers:
  - William Hicks (https://github.com/wphicks)

URL: #836
  • Loading branch information
cjnolet authored Sep 23, 2022
1 parent 365293a commit c9d683c
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions cpp/include/raft/core/detail/macros.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,18 @@

#ifndef _RAFT_HOST_DEVICE
#if defined(_RAFT_HAS_CUDA)
#define _RAFT_HOST_DEVICE __host__ __device__
#define _RAFT_DEVICE __device__
#define _RAFT_HOST __host__
#define _RAFT_FORCEINLINE __forceinline__
#else
#define _RAFT_HOST_DEVICE
#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

0 comments on commit c9d683c

Please sign in to comment.