@@ -24,10 +24,10 @@ namespace cms {
2424 const uint32_t nt = offsets[nh];
2525 cms::alpakatools::for_each_element_in_grid_strided (acc, nt, [&](uint32_t i) {
2626 auto off = alpaka_std::upper_bound (offsets, offsets + nh + 1 , i);
27- assert ((*off) > 0 );
27+ ALPAKA_ASSERT_OFFLOAD ((*off) > 0 );
2828 int32_t ih = off - offsets - 1 ;
29- assert (ih >= 0 );
30- assert (ih < int (nh));
29+ ALPAKA_ASSERT_OFFLOAD (ih >= 0 );
30+ ALPAKA_ASSERT_OFFLOAD (ih < int (nh));
3131 h->count (acc, v[i], ih);
3232 });
3333 }
@@ -44,10 +44,10 @@ namespace cms {
4444
4545 cms::alpakatools::for_each_element_in_grid_strided (acc, nt, [&](uint32_t i) {
4646 auto off = alpaka_std::upper_bound (offsets, offsets + nh + 1 , i);
47- assert ((*off) > 0 );
47+ ALPAKA_ASSERT_OFFLOAD ((*off) > 0 );
4848 int32_t ih = off - offsets - 1 ;
49- assert (ih >= 0 );
50- assert (ih < int (nh));
49+ ALPAKA_ASSERT_OFFLOAD (ih >= 0 );
50+ ALPAKA_ASSERT_OFFLOAD (ih < int (nh));
5151 h->fill (acc, v[i], i, ih);
5252 });
5353 }
@@ -125,7 +125,7 @@ namespace cms {
125125 int bs = Hist::bin (value);
126126 int be = std::min (int (Hist::nbins () - 1 ), bs + n);
127127 bs = std::max (0 , bs - n);
128- assert (be >= bs);
128+ ALPAKA_ASSERT_OFFLOAD (be >= bs);
129129 for (auto pj = hist.begin (bs); pj < hist.end (be); ++pj) {
130130 func (*pj);
131131 }
@@ -136,7 +136,7 @@ namespace cms {
136136 ALPAKA_FN_HOST_ACC ALPAKA_FN_INLINE void forEachInWindow (Hist const &hist, V wmin, V wmax, Func const &func) {
137137 auto bs = Hist::bin (wmin);
138138 auto be = Hist::bin (wmax);
139- assert (be >= bs);
139+ ALPAKA_ASSERT_OFFLOAD (be >= bs);
140140 for (auto pj = hist.begin (bs); pj < hist.end (be); ++pj) {
141141 func (*pj);
142142 }
@@ -210,15 +210,15 @@ namespace cms {
210210
211211 template <typename T_Acc>
212212 ALPAKA_FN_ACC ALPAKA_FN_INLINE void countDirect (const T_Acc &acc, T b) {
213- assert (b < nbins ());
213+ ALPAKA_ASSERT_OFFLOAD (b < nbins ());
214214 atomicIncrement (acc, off[b]);
215215 }
216216
217217 template <typename T_Acc>
218218 ALPAKA_FN_ACC ALPAKA_FN_INLINE void fillDirect (const T_Acc &acc, T b, index_type j) {
219- assert (b < nbins ());
219+ ALPAKA_ASSERT_OFFLOAD (b < nbins ());
220220 auto w = atomicDecrement (acc, off[b]);
221- assert (w > 0 );
221+ ALPAKA_ASSERT_OFFLOAD (w > 0 );
222222 bins[w - 1 ] = j;
223223 }
224224
@@ -255,44 +255,44 @@ namespace cms {
255255 template <typename T_Acc>
256256 ALPAKA_FN_ACC ALPAKA_FN_INLINE void count (const T_Acc &acc, T t) {
257257 uint32_t b = bin (t);
258- assert (b < nbins ());
258+ ALPAKA_ASSERT_OFFLOAD (b < nbins ());
259259 atomicIncrement (acc, off[b]);
260260 }
261261
262262 template <typename T_Acc>
263263 ALPAKA_FN_ACC ALPAKA_FN_INLINE void fill (const T_Acc &acc, T t, index_type j) {
264264 uint32_t b = bin (t);
265- assert (b < nbins ());
265+ ALPAKA_ASSERT_OFFLOAD (b < nbins ());
266266 auto w = atomicDecrement (acc, off[b]);
267- assert (w > 0 );
267+ ALPAKA_ASSERT_OFFLOAD (w > 0 );
268268 bins[w - 1 ] = j;
269269 }
270270
271271 template <typename T_Acc>
272272 ALPAKA_FN_ACC ALPAKA_FN_INLINE void count (const T_Acc &acc, T t, uint32_t nh) {
273273 uint32_t b = bin (t);
274- assert (b < nbins ());
274+ ALPAKA_ASSERT_OFFLOAD (b < nbins ());
275275 b += histOff (nh);
276- assert (b < totbins ());
276+ ALPAKA_ASSERT_OFFLOAD (b < totbins ());
277277 atomicIncrement (acc, off[b]);
278278 }
279279
280280 template <typename T_Acc>
281281 ALPAKA_FN_ACC ALPAKA_FN_INLINE void fill (const T_Acc &acc, T t, index_type j, uint32_t nh) {
282282 uint32_t b = bin (t);
283- assert (b < nbins ());
283+ ALPAKA_ASSERT_OFFLOAD (b < nbins ());
284284 b += histOff (nh);
285- assert (b < totbins ());
285+ ALPAKA_ASSERT_OFFLOAD (b < totbins ());
286286 auto w = atomicDecrement (acc, off[b]);
287- assert (w > 0 );
287+ ALPAKA_ASSERT_OFFLOAD (w > 0 );
288288 bins[w - 1 ] = j;
289289 }
290290
291291 template <typename T_Acc>
292292 ALPAKA_FN_ACC ALPAKA_FN_INLINE void finalize (const T_Acc &acc, Counter *ws = nullptr ) {
293- assert (off[totbins () - 1 ] == 0 );
293+ ALPAKA_ASSERT_OFFLOAD (off[totbins () - 1 ] == 0 );
294294 blockPrefixScan (acc, off, totbins (), ws);
295- assert (off[totbins () - 1 ] == off[totbins () - 2 ]);
295+ ALPAKA_ASSERT_OFFLOAD (off[totbins () - 1 ] == off[totbins () - 2 ]);
296296 }
297297
298298 constexpr auto size () const { return uint32_t (off[totbins () - 1 ]); }
0 commit comments