Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

preprocessor syntax fix #1582

Merged
merged 1 commit into from
Jun 8, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions cpp/include/raft/core/math.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

#include <raft/core/detail/macros.hpp>

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
#include <cuda_bf16.h>
#include <cuda_fp16.h>
#endif
Expand Down Expand Up @@ -108,7 +108,7 @@ RAFT_INLINE_FUNCTION auto cos(T x)
#endif
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> cos(T x)
{
Expand Down Expand Up @@ -149,7 +149,7 @@ RAFT_INLINE_FUNCTION auto sin(T x)
#endif
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> sin(T x)
{
Expand Down Expand Up @@ -219,7 +219,7 @@ RAFT_INLINE_FUNCTION auto exp(T x)
#endif
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> exp(T x)
{
Expand Down Expand Up @@ -260,7 +260,7 @@ RAFT_INLINE_FUNCTION auto log(T x)
#endif
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> log(T x)
{
Expand Down Expand Up @@ -339,7 +339,7 @@ RAFT_INLINE_FUNCTION auto max(const T1& x, const T2& y)
#endif
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> max(T x,
T y)
Expand Down Expand Up @@ -381,7 +381,7 @@ constexpr RAFT_INLINE_FUNCTION auto max(const T& x)
return x;
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> max(T x)
{
Expand Down Expand Up @@ -461,7 +461,7 @@ RAFT_INLINE_FUNCTION auto min(const T1& x, const T2& y)
#endif
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> min(T x,
T y)
Expand Down Expand Up @@ -503,7 +503,7 @@ constexpr RAFT_INLINE_FUNCTION auto min(const T& x)
return x;
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, nv_bfloat16>, __half> min(
T x)
Expand Down Expand Up @@ -561,7 +561,7 @@ RAFT_INLINE_FUNCTION auto sqrt(T x)
#endif
}

#if _RAFT_HAS_CUDA
#if defined(_RAFT_HAS_CUDA)
template <typename T>
RAFT_DEVICE_INLINE_FUNCTION typename std::enable_if_t<std::is_same_v<T, __half>, __half> sqrt(T x)
{
Expand Down