We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
From https://github.com/cms-patatrack/pixeltrack-standalone/pull/165/files#r565486352
A pattern
const auto gridDim = ...; const auto [firstNoStride, endNoStride] = ...; for (auto threadIdx = firstNoStride, endElementIdx = endNoStride; threadIdx < MAX; threadIdx += gridDimension, endElementIdx += gridDimension) { for (auto i = threadIdx; i < std::min(endElementIdx, MAX); ++i ) { <body> } }
seems to repeat often. The pattern could be abstracted along
namespace cms::alpakatools { // the name should be more descriptive... template <typename T_Acc, typename N, typename Func> inline void for_each_element(const T_Acc& acc, const N nitems, Func func) { const auto gridDim = ...; const auto [firstNoStride, endNoStride] = ...; for (auto threadIdx = firstNoStride, endElementIdx = endNoStride; threadIdx < nitems; threadIdx += gridDimension, endElementIdx += gridDimension) { for (auto i = threadIdx; i < std::min(endElementIdx, nitems); ++i ) { func(i); } } } }
that could be called along
const uint32_t nt = offsets[nh]; cms::alpakatools::for_each_element(acc, nt, [&](uint32_t i) { auto off = alpaka_std::upper_bound(offsets, offsets + nh + 1, i); ... }
The text was updated successfully, but these errors were encountered:
No branches or pull requests
From https://github.com/cms-patatrack/pixeltrack-standalone/pull/165/files#r565486352
A pattern
seems to repeat often. The pattern could be abstracted along
that could be called along
The text was updated successfully, but these errors were encountered: