@@ -41,8 +41,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
4141 CoordinateExtremes<Ndim>* minmax;
4242 float * tilesizes;
4343 size_t npoints;
44- size_t ntiles;
45- size_t nperdim;
44+ int32_t ntiles;
45+ int32_t nperdim;
4646
4747 ALPAKA_FN_ACC inline constexpr const float * minMax () const { return minmax; }
4848 ALPAKA_FN_ACC inline constexpr float * minMax () { return minmax; }
@@ -57,7 +57,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
5757 int coord_bin{(int )((coord - minmax->min (dim)) / tilesizes[dim])};
5858
5959 // Address the cases of underflow and overflow
60- coord_bin = alpaka::math::min (acc, ( size_t ) coord_bin, nperdim - 1 );
60+ coord_bin = alpaka::math::min (acc, coord_bin, nperdim - 1 );
6161 coord_bin = alpaka::math::max (acc, coord_bin, 0 );
6262
6363 return coord_bin;
@@ -111,7 +111,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
111111 template <uint8_t Ndim>
112112 class TilesAlpaka {
113113 public:
114- TilesAlpaka (Queue queue, uint32_t n_points, uint32_t n_perdim, uint32_t n_tiles)
114+ TilesAlpaka (Queue queue, uint32_t n_points, int32_t n_perdim, uint32_t n_tiles)
115115 : m_ntiles{n_tiles},
116116 m_nperdim{n_perdim},
117117 m_minmax{clue::make_device_buffer<CoordinateExtremes<Ndim>>(queue)},
@@ -125,7 +125,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
125125 host_view->tilesizes = m_tilesizes.data ();
126126 host_view->npoints = n_points;
127127 host_view->ntiles = n_tiles;
128- host_view->nperdim = n_perdim;
128+ host_view->nperdim = n_perdim;
129129
130130 alpaka::memcpy (queue, m_view, host_view);
131131 }
@@ -137,27 +137,25 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
137137 m_assoc.initialize (size, nbins, queue);
138138 }
139139
140- struct GetGlobalBin {
141- PointsAlpaka<Ndim>::PointsAlpakaView* pointsView;
142- TilesAlpakaView<Ndim>* tilesView;
140+ struct GetGlobalBin {
141+ PointsAlpaka<Ndim>::PointsAlpakaView* pointsView;
142+ TilesAlpakaView<Ndim>* tilesView;
143143
144- template <typename TAcc>
145- ALPAKA_FN_ACC uint32_t operator ()(const TAcc& acc, uint32_t index) const {
144+ template <typename TAcc>
145+ ALPAKA_FN_ACC uint32_t operator ()(const TAcc& acc, uint32_t index) const {
146146 float coords[Ndim];
147147 for (auto dim = 0 ; dim < Ndim; ++dim) {
148148 coords[dim] = pointsView->coords [index + dim * pointsView->n ];
149149 }
150150
151- auto bin = tilesView->getGlobalBin (acc, coords);
151+ auto bin = tilesView->getGlobalBin (acc, coords);
152152 return bin;
153- }
154- };
153+ }
154+ };
155155
156- ALPAKA_FN_HOST void fill (Queue queue,
157- PointsAlpaka<Ndim>& d_points,
158- size_t size) {
156+ ALPAKA_FN_HOST void fill (Queue queue, PointsAlpaka<Ndim>& d_points, size_t size) {
159157 auto dev = alpaka::getDev (queue);
160- auto pointsView = d_points.view ();
158+ auto pointsView = d_points.view ();
161159 m_assoc.fill (size, GetGlobalBin{pointsView, m_view.data ()}, queue);
162160 }
163161
@@ -176,7 +174,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
176174 ALPAKA_FN_HOST inline constexpr void clear (const Queue& queue) {}
177175
178176 ALPAKA_FN_HOST clue::device_view<Device, uint32_t []> indexes (const Device& dev,
179- size_t assoc_id) {
177+ size_t assoc_id) {
180178 return m_assoc.indexes (dev, assoc_id);
181179 }
182180
@@ -185,8 +183,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
185183 clue::device_buffer<Device, CoordinateExtremes<Ndim>> m_minmax;
186184 clue::device_buffer<Device, float [Ndim]> m_tilesizes;
187185 clue::device_buffer<Device, TilesAlpakaView<Ndim>> m_view;
188- uint32_t m_ntiles;
189- uint32_t m_nperdim;
186+ int32_t m_ntiles;
187+ int32_t m_nperdim;
190188 };
191189
192190} // namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE
0 commit comments