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

Generalize warp size in pixel clustering kernel #46426

Merged
merged 1 commit into from
Oct 18, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -182,8 +182,13 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering {
TrackerTraits::maxPixInModule,
TrackerTraits::clusterBits,
uint16_t>;
#if defined(__HIP_DEVICE_COMPILE__)
constexpr auto warpSize = __AMDGCN_WAVEFRONT_SIZE;
#else
constexpr auto warpSize = 32;
#endif
auto& hist = alpaka::declareSharedVar<Hist, __COUNTER__>(acc);
auto& ws = alpaka::declareSharedVar<typename Hist::Counter[32], __COUNTER__>(acc);
auto& ws = alpaka::declareSharedVar<typename Hist::Counter[warpSize], __COUNTER__>(acc);
for (uint32_t j : cms::alpakatools::independent_group_elements(acc, Hist::totbins())) {
hist.off[j] = 0;
}
Expand Down Expand Up @@ -254,7 +259,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE::pixelClustering {
}
}
alpaka::syncBlockThreads(acc); // FIXME this can be removed
for (uint32_t i : cms::alpakatools::independent_group_elements(acc, 32u)) {
for (uint32_t i : cms::alpakatools::independent_group_elements(acc, warpSize)) {
ws[i] = 0; // used by prefix scan...
}
alpaka::syncBlockThreads(acc);
Expand Down