Skip to content

Commit

Permalink
[ciskip] HIP: Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Damien L-G <dalg24+github@gmail.com>
Co-authored-by: Daniel Arndt <arndtd@ornl.gov>
  • Loading branch information
3 people committed Mar 6, 2023
1 parent 6554e2a commit 368a328
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions core/src/HIP/Kokkos_HIP_Parallel_MDRange.hpp
Expand Up @@ -200,8 +200,9 @@ class ParallelReduce<CombinedFunctorReducerType,
// offset rather than at every 4 byte word; such that, when the join is
// performed, we have the correct data that was copied over in chunks of 4
// bytes.
static_assert(sizeof(size_type) == 4);
using word_size_type = std::conditional_t<
sizeof(value_type) < sizeof(size_type),
sizeof(value_type) < 4,
std::conditional_t<sizeof(value_type) == 2, int16_t, int8_t>, size_type>;

// Algorithmic constraints: blockSize is a power of two AND blockDim.y ==
Expand Down Expand Up @@ -313,9 +314,9 @@ class ParallelReduce<CombinedFunctorReducerType,
: suggested_blocksize; // Note: block_size must be less
// than or equal to 512

m_scratch_space = (word_size_type*)hip_internal_scratch_space(
m_scratch_space = (reinterpret_cast<word_size_type*>(hip_internal_scratch_space(
m_policy.space(), reducer.value_size() *
block_size /* block_size == max block_count */);
block_size /* block_size == max block_count */));
m_scratch_flags =
hip_internal_scratch_flags(m_policy.space(), sizeof(size_type));

Expand Down

0 comments on commit 368a328

Please sign in to comment.