diff --git a/include/CLUEstering/DataFormats/alpaka/TilesAlpaka.hpp b/include/CLUEstering/DataFormats/alpaka/TilesAlpaka.hpp index 0cb17f3a..85720272 100644 --- a/include/CLUEstering/DataFormats/alpaka/TilesAlpaka.hpp +++ b/include/CLUEstering/DataFormats/alpaka/TilesAlpaka.hpp @@ -74,20 +74,23 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE { template ALPAKA_FN_HOST_ACC inline constexpr int getGlobalBin( const TAcc& acc, const VecArray& coords) const { - int globalBin{getBin(acc, coords[0], 0)}; - for (int i{1}; i != Ndim; ++i) { - globalBin += n_tiles_per_dim * getBin(acc, coords[i], i); + int globalBin = 0; + for (int dim = 0; dim != Ndim - 1; ++dim) { + globalBin += alpaka::math::pow(acc, n_tiles_per_dim, Ndim - dim - 1) * + getBin(acc, coords[dim], dim); } + globalBin += getBin(acc, coords[Ndim - 1], Ndim - 1); return globalBin; } template ALPAKA_FN_HOST_ACC inline constexpr int getGlobalBinByBin( - const TAcc&, const VecArray& Bins) const { - uint32_t globalBin{Bins[0]}; - for (int i{1}; i != Ndim; ++i) { - globalBin += n_tiles_per_dim * Bins[i]; + const TAcc& acc, const VecArray& Bins) const { + uint32_t globalBin = 0; + for (int dim = 0; dim != Ndim - 1; ++dim) { + globalBin += alpaka::math::pow(acc, n_tiles_per_dim, Ndim - dim - 1) * Bins[dim]; } + globalBin += Bins[Ndim - 1]; return globalBin; } diff --git a/setup.py b/setup.py index 7ccc5e06..353935de 100644 --- a/setup.py +++ b/setup.py @@ -4,7 +4,7 @@ from setuptools import setup import subprocess -__version__ = "2.3.2.1" +__version__ = "2.3.3" this_directory = Path(__file__).parent long_description = (this_directory/'README.md').read_text()