@@ -41,8 +41,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
41
41
CoordinateExtremes<Ndim>* minmax;
42
42
float * tilesizes;
43
43
size_t npoints;
44
- size_t ntiles;
45
- size_t nperdim;
44
+ int32_t ntiles;
45
+ int32_t nperdim;
46
46
47
47
ALPAKA_FN_ACC inline constexpr const float * minMax () const { return minmax; }
48
48
ALPAKA_FN_ACC inline constexpr float * minMax () { return minmax; }
@@ -57,7 +57,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
57
57
int coord_bin{(int )((coord - minmax->min (dim)) / tilesizes[dim])};
58
58
59
59
// 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 );
61
61
coord_bin = alpaka::math::max (acc, coord_bin, 0 );
62
62
63
63
return coord_bin;
@@ -111,7 +111,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
111
111
template <uint8_t Ndim>
112
112
class TilesAlpaka {
113
113
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)
115
115
: m_ntiles{n_tiles},
116
116
m_nperdim{n_perdim},
117
117
m_minmax{clue::make_device_buffer<CoordinateExtremes<Ndim>>(queue)},
@@ -125,7 +125,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
125
125
host_view->tilesizes = m_tilesizes.data ();
126
126
host_view->npoints = n_points;
127
127
host_view->ntiles = n_tiles;
128
- host_view->nperdim = n_perdim;
128
+ host_view->nperdim = n_perdim;
129
129
130
130
alpaka::memcpy (queue, m_view, host_view);
131
131
}
@@ -137,27 +137,25 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
137
137
m_assoc.initialize (size, nbins, queue);
138
138
}
139
139
140
- struct GetGlobalBin {
141
- PointsAlpaka<Ndim>::PointsAlpakaView* pointsView;
142
- TilesAlpakaView<Ndim>* tilesView;
140
+ struct GetGlobalBin {
141
+ PointsAlpaka<Ndim>::PointsAlpakaView* pointsView;
142
+ TilesAlpakaView<Ndim>* tilesView;
143
143
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 {
146
146
float coords[Ndim];
147
147
for (auto dim = 0 ; dim < Ndim; ++dim) {
148
148
coords[dim] = pointsView->coords [index + dim * pointsView->n ];
149
149
}
150
150
151
- auto bin = tilesView->getGlobalBin (acc, coords);
151
+ auto bin = tilesView->getGlobalBin (acc, coords);
152
152
return bin;
153
- }
154
- };
153
+ }
154
+ };
155
155
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) {
159
157
auto dev = alpaka::getDev (queue);
160
- auto pointsView = d_points.view ();
158
+ auto pointsView = d_points.view ();
161
159
m_assoc.fill (size, GetGlobalBin{pointsView, m_view.data ()}, queue);
162
160
}
163
161
@@ -176,7 +174,7 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
176
174
ALPAKA_FN_HOST inline constexpr void clear (const Queue& queue) {}
177
175
178
176
ALPAKA_FN_HOST clue::device_view<Device, uint32_t []> indexes (const Device& dev,
179
- size_t assoc_id) {
177
+ size_t assoc_id) {
180
178
return m_assoc.indexes (dev, assoc_id);
181
179
}
182
180
@@ -185,8 +183,8 @@ namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE {
185
183
clue::device_buffer<Device, CoordinateExtremes<Ndim>> m_minmax;
186
184
clue::device_buffer<Device, float [Ndim]> m_tilesizes;
187
185
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;
190
188
};
191
189
192
190
} // namespace ALPAKA_ACCELERATOR_NAMESPACE_CLUE
0 commit comments