Skip to content

Commit

Permalink
Proper API locations
Browse files Browse the repository at this point in the history
  • Loading branch information
thorstenhater committed Jan 10, 2025
1 parent 0312e2e commit c423b38
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
5 changes: 4 additions & 1 deletion arbor/include/arbor/gpu/cuda_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -138,11 +138,14 @@ inline float gpu_atomic_sub(float* address, float val) {
}

/// Warp-Level Primitives

__device__ __inline__ unsigned ballot(unsigned mask, unsigned is_root) {
return __ballot_sync(mask, is_root);
}

__device__ __inline__ unsigned active_mask() {
return __active_mask();
}

__device__ __inline__ unsigned any(unsigned mask, unsigned width) {
return __any_sync(mask, width);
}
Expand Down
7 changes: 5 additions & 2 deletions arbor/include/arbor/gpu/hip_api.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,7 @@ inline float gpu_atomic_sub(float* address, float val) {
template<typename T>
__device__ __inline__
std::enable_if_t< !std::is_same_v<std::decay_t<T>, double>, std::decay_t<T>>
shfl(T x, int lane)
{
shfl(T x, int lane) {
return __shfl(x, lane);
}

Expand All @@ -142,6 +141,10 @@ __device__ __inline__ unsigned ballot(unsigned mask, unsigned is_root) {
return __ballot(is_root);
}

__device__ __inline__ unsigned active_mask() {
return __active_mask();
}

__device__ __inline__ unsigned any(unsigned mask, unsigned width) {
return __any(width);
}
Expand Down

0 comments on commit c423b38

Please sign in to comment.