Skip to content

Commit

Permalink
Desul atomics: prefer __CLANG_RDC__ macro
Browse files Browse the repository at this point in the history
  • Loading branch information
dalg24 committed Mar 2, 2023
1 parent 7e4665d commit 554032e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
8 changes: 4 additions & 4 deletions tpls/desul/include/desul/atomics/Lock_Array_HIP.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,12 @@ void finalize_lock_arrays_hip();
* will use it. That is the purpose of the
* ensure_hip_lock_arrays_on_device function.
*/
#ifdef DESUL_HIP_RDC
#ifdef __CLANG_RDC__
extern
#endif
__device__ __constant__ int32_t* HIP_SPACE_ATOMIC_LOCKS_DEVICE;

#ifdef DESUL_HIP_RDC
#ifdef __CLANG_RDC__
extern
#endif
__device__ __constant__ int32_t* HIP_SPACE_ATOMIC_LOCKS_NODE;
Expand Down Expand Up @@ -120,7 +120,7 @@ namespace {
static int lock_array_copied = 0;
} // namespace

#ifdef DESUL_HIP_RDC
#ifdef __CLANG_RDC__
inline
#else
inline static
Expand All @@ -139,7 +139,7 @@ inline static
}
} // namespace Impl

#if defined(DESUL_HIP_RDC)
#if defined(__CLANG_RDC__)
inline void ensure_hip_lock_arrays_on_device() {}
#else
static inline void ensure_hip_lock_arrays_on_device() {
Expand Down
4 changes: 2 additions & 2 deletions tpls/desul/src/Lock_Array_HIP.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ SPDX-License-Identifier: (BSD-3-Clause)
#include <sstream>
#include <string>

#ifdef DESUL_HIP_RDC
#ifdef __CLANG_RDC__
namespace desul {
namespace Impl {
__device__ __constant__ int32_t* HIP_SPACE_ATOMIC_LOCKS_DEVICE = nullptr;
Expand Down Expand Up @@ -87,7 +87,7 @@ void finalize_lock_arrays_hip() {
check_error_and_throw_hip(error_free2, "finalize_lock_arrays_hip: free host locks");
HIP_SPACE_ATOMIC_LOCKS_DEVICE_h = nullptr;
HIP_SPACE_ATOMIC_LOCKS_NODE_h = nullptr;
#ifdef DESUL_HIP_RDC
#ifdef __CLANG_RDC__
copy_hip_lock_arrays_to_device();
#endif
}
Expand Down

0 comments on commit 554032e

Please sign in to comment.