Skip to content

Commit

Permalink
Merge pull request #48 from kstppd/fasterCompactions
Browse files Browse the repository at this point in the history
Faster compactions for up to 1024 elements
  • Loading branch information
kstppd authored Mar 8, 2024
2 parents 6e964cd + 602108c commit ce93cb0
Show file tree
Hide file tree
Showing 8 changed files with 394 additions and 57 deletions.
2 changes: 1 addition & 1 deletion include/hashinator/hashinator.h
Original file line number Diff line number Diff line change
Expand Up @@ -1110,7 +1110,7 @@ class Hashmap {

// Allocate with Mempool
const size_t memory_for_pool = 8 * nBlocks * sizeof(uint32_t);
split::tools::Cuda_mempool mPool(memory_for_pool, s);
split::tools::splitStackArena mPool(memory_for_pool, s);
size_t retval =
split::tools::copy_if_raw<hash_pair<KEY_TYPE, VAL_TYPE>, Rule, defaults::MAX_BLOCKSIZE, defaults::WARPSIZE>(
buckets, elements, rule, nBlocks, mPool, s);
Expand Down
21 changes: 21 additions & 0 deletions include/splitvector/gpu_wrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -261,5 +261,26 @@ __device__ __forceinline__ T s_shuffle_down(T variable, unsigned int delta, U ma
return __shfl_down(variable, delta);
#endif
}

/**
* @brief Wrapper for performing an up register shuffle operation.
*
* @tparam T The data type of the variable.
* @tparam U The data type of the mask.
* @param variable The variable to shuffle.
* @param delta The offset.
* @param mask Voting mask.
* @return The shuffled variable.
*/
template <typename T, typename U>
__device__ __forceinline__ T s_shuffle_up(T variable, unsigned int delta, U mask = 0) noexcept {
static_assert(std::is_integral<T>::value && "Only integers supported");
#ifdef __NVCC__
return __shfl_up_sync(mask, variable, delta);
#endif
#ifdef __HIP__
return __shfl_up(variable, delta);
#endif
}
} // namespace split
#endif
Loading

0 comments on commit ce93cb0

Please sign in to comment.