Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
AMReX_Loop.H
Go to the documentation of this file.
1#ifndef AMREX_LOOP_H_
2#define AMREX_LOOP_H_
3#include <AMReX_Config.H>
4
5#include <AMReX_Box.H>
7#include <AMReX_Extension.H>
8
9namespace amrex {
10
11namespace loop_detail {
12
13 // call_f_intvect_inner
14
15 template <typename F, std::size_t...Ns, class...Args>
17 auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<1> iv, Args...args)
18 noexcept -> decltype(f(0, 0, 0, args...))
19 {
20 f(iv[0], 0, 0, args...);
21 }
22
23 template <typename F, std::size_t...Ns, class...Args>
25 auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<2> iv, Args...args)
26 noexcept -> decltype(f(0, 0, 0, args...))
27 {
28 f(iv[0], iv[1], 0, args...);
29 }
30
31 template <typename F, int dim, std::size_t...Ns, class...Args>
33 auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
34 noexcept -> decltype(f(iv, args...))
35 {
36 f(iv, args...);
37 }
38
39 template <typename F, int dim, std::size_t...Ns, class...Args>
41 auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
42 noexcept -> decltype(f(iv[Ns]..., args...))
43 {
44 f(iv[Ns]..., args...);
45 }
46
47 // call_f_intvect
48
49 template <typename F, int dim>
51 auto call_f_intvect (F const& f, IntVectND<dim> iv)
52 noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv))
53 {
54 call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv);
55 }
56
57 // call_f_intvect_ncomp
58
59 template <typename F, int dim>
61 auto call_f_intvect_ncomp (F const& f, IntVectND<dim> iv, int n)
62 noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv, 0))
63 {
64 call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv, n);
65 }
66
67 // call_f_intvect_inner_cpu
68
69 template <typename F, std::size_t...Ns, class...Args>
71 auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<1> iv, Args...args)
72 noexcept -> decltype(f(0, 0, 0, args...))
73 {
74 f(iv[0], 0, 0, args...);
75 }
76
77 template <typename F, std::size_t...Ns, class...Args>
79 auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<2> iv, Args...args)
80 noexcept -> decltype(f(0, 0, 0, args...))
81 {
82 f(iv[0], iv[1], 0, args...);
83 }
84
85 template <typename F, int dim, std::size_t...Ns, class...Args>
87 auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
88 noexcept -> decltype(f(iv, args...))
89 {
90 f(iv, args...);
91 }
92
93 template <typename F, int dim, std::size_t...Ns, class...Args>
95 auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
96 noexcept -> decltype(f(iv[Ns]..., args...))
97 {
98 f(iv[Ns]..., args...);
99 }
100
101 // call_f_intvect_cpu
102
103 template <typename F, int dim>
106 noexcept -> decltype(call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv))
107 {
108 call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv);
109 }
110
111 // call_f_intvect_ncomp_cpu
112
113 template <typename F, int dim>
115 auto call_f_intvect_ncomp_cpu (F const& f, IntVectND<dim> iv, int n)
116 noexcept -> decltype(call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv, 0))
117 {
118 call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv, n);
119 }
120}
121
122template <class F>
125void Loop (Dim3 lo, Dim3 hi, F const& f) noexcept
126{
127 for (int k = lo.z; k <= hi.z; ++k) {
128 for (int j = lo.y; j <= hi.y; ++j) {
129 for (int i = lo.x; i <= hi.x; ++i) {
130 f(i,j,k);
131 }}}
132}
133
134template <class F>
137void Loop (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
138{
139 for (int n = 0; n < ncomp; ++n) {
140 for (int k = lo.z; k <= hi.z; ++k) {
141 for (int j = lo.y; j <= hi.y; ++j) {
142 for (int i = lo.x; i <= hi.x; ++i) {
143 f(i,j,k,n);
144 }}}}
145}
146
147template <class F>
150void LoopConcurrent (Dim3 lo, Dim3 hi, F const& f) noexcept
151{
152 for (int k = lo.z; k <= hi.z; ++k) {
153 for (int j = lo.y; j <= hi.y; ++j) {
155 for (int i = lo.x; i <= hi.x; ++i) {
156 f(i,j,k);
157 }}}
158}
159
160template <class F>
163void LoopConcurrent (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
164{
165 for (int n = 0; n < ncomp; ++n) {
166 for (int k = lo.z; k <= hi.z; ++k) {
167 for (int j = lo.y; j <= hi.y; ++j) {
169 for (int i = lo.x; i <= hi.x; ++i) {
170 f(i,j,k,n);
171 }}}}
172}
173
174namespace loop_detail {
175
176template <int idim, typename L, int dim>
178void Loop_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
179{
180 if constexpr (idim == 1) {
181 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
182 call_f_intvect(f,iv);
183 }
184 } else if constexpr (idim == 2) {
185 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
186 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
187 call_f_intvect(f,iv);
188 }}
189 } else if constexpr (idim == 3) {
190 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
191 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
192 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
193 call_f_intvect(f,iv);
194 }}}
195 } else {
196 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
197 Loop_impND<idim-1>(f, lo, hi, iv);
198 }
199 }
200}
201
202}
203
204template <class F, int dim>
207void Loop (BoxND<dim> const& bx, F const& f) noexcept
208{
209 const auto lo = amrex::lbound_iv(bx);
210 const auto hi = amrex::ubound_iv(bx);
212 loop_detail::Loop_impND<dim>(f, lo, hi, iv);
213}
214
215namespace loop_detail {
216
217template <int idim, typename L, int dim>
219void Loop_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
220{
221 if constexpr (idim == 1) {
222 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
223 call_f_intvect_ncomp(f,iv,n);
224 }
225 } else if constexpr (idim == 2) {
226 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
227 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
228 call_f_intvect_ncomp(f,iv,n);
229 }}
230 } else if constexpr (idim == 3) {
231 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
232 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
233 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
234 call_f_intvect_ncomp(f,iv,n);
235 }}}
236 } else {
237 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
238 Loop_impND<idim-1>(f, lo, hi, iv, n);
239 }
240 }
241}
242
243}
244
245template <class F, int dim>
248void Loop (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
249{
250 const auto lo = amrex::lbound_iv(bx);
251 const auto hi = amrex::ubound_iv(bx);
253 for (int n = 0; n < ncomp; ++n) {
254 loop_detail::Loop_impND<dim>(f, lo, hi, iv, n);
255 }
256}
257
258namespace loop_detail {
259
260template <int idim, typename L, int dim>
262void LoopConcurrent_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
263{
264 if constexpr (idim == 1) {
266 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
267 call_f_intvect(f,iv);
268 }
269 } else if constexpr (idim == 2) {
270 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
272 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
273 call_f_intvect(f,iv);
274 }}
275 } else if constexpr (idim == 3) {
276 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
277 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
279 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
280 call_f_intvect(f,iv);
281 }}}
282 } else {
283 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
284 LoopConcurrent_impND<idim-1>(f, lo, hi, iv);
285 }
286 }
287}
288
289}
290
291template <class F, int dim>
294void LoopConcurrent (BoxND<dim> const& bx, F const& f) noexcept
295{
296 const auto lo = amrex::lbound_iv(bx);
297 const auto hi = amrex::ubound_iv(bx);
299 loop_detail::LoopConcurrent_impND<dim>(f, lo, hi, iv);
300}
301
302namespace loop_detail {
303
304template <int idim, typename L, int dim>
306void LoopConcurrent_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
307{
308 if constexpr (idim == 1) {
310 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
311 call_f_intvect_ncomp(f,iv,n);
312 }
313 } else if constexpr (idim == 2) {
314 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
316 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
317 call_f_intvect_ncomp(f,iv,n);
318 }}
319 } else if constexpr (idim == 3) {
320 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
321 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
323 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
324 call_f_intvect_ncomp(f,iv,n);
325 }}}
326 } else {
327 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
328 LoopConcurrent_impND<idim-1>(f, lo, hi, iv, n);
329 }
330 }
331}
332
333}
334
335template <class F, int dim>
338void LoopConcurrent (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
339{
340 const auto lo = amrex::lbound_iv(bx);
341 const auto hi = amrex::ubound_iv(bx);
343 for (int n = 0; n < ncomp; ++n) {
344 loop_detail::LoopConcurrent_impND<dim>(f, lo, hi, iv, n);
345 }
346}
347
348// The functions above are __host__ __device__ functions. If f is not a
349// __host__ __device__ function, we will get warning about calling __host__
350// function from a __host__ __device__ function. This is ugly. To get rid
351// of the warning, we have to use the functions below for those situations.
352
353template <class F>
355void LoopOnCpu (Dim3 lo, Dim3 hi, F const& f) noexcept
356{
357 for (int k = lo.z; k <= hi.z; ++k) {
358 for (int j = lo.y; j <= hi.y; ++j) {
359 for (int i = lo.x; i <= hi.x; ++i) {
360 f(i,j,k);
361 }}}
362}
363
364template <class F>
366void LoopOnCpu (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
367{
368 for (int n = 0; n < ncomp; ++n) {
369 for (int k = lo.z; k <= hi.z; ++k) {
370 for (int j = lo.y; j <= hi.y; ++j) {
371 for (int i = lo.x; i <= hi.x; ++i) {
372 f(i,j,k,n);
373 }}}}
374}
375
376template <class F>
378void LoopConcurrentOnCpu (Dim3 lo, Dim3 hi, F const& f) noexcept
379{
380 for (int k = lo.z; k <= hi.z; ++k) {
381 for (int j = lo.y; j <= hi.y; ++j) {
383 for (int i = lo.x; i <= hi.x; ++i) {
384 f(i,j,k);
385 }}}
386}
387
388template <class F>
390void LoopConcurrentOnCpu (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
391{
392 for (int n = 0; n < ncomp; ++n) {
393 for (int k = lo.z; k <= hi.z; ++k) {
394 for (int j = lo.y; j <= hi.y; ++j) {
396 for (int i = lo.x; i <= hi.x; ++i) {
397 f(i,j,k,n);
398 }}}}
399}
400
401namespace loop_detail {
402
403template <int idim, typename L, int dim>
405void LoopOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
406{
407 if constexpr (idim == 1) {
408 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
409 call_f_intvect_cpu(f,iv);
410 }
411 } else if constexpr (idim == 2) {
412 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
413 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
414 call_f_intvect_cpu(f,iv);
415 }}
416 } else if constexpr (idim == 3) {
417 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
418 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
419 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
420 call_f_intvect_cpu(f,iv);
421 }}}
422 } else {
423 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
424 LoopOnCpu_impND<idim-1>(f, lo, hi, iv);
425 }
426 }
427}
428
429}
430
431template <class F, int dim>
433void LoopOnCpu (BoxND<dim> const& bx, F const& f) noexcept
434{
435 const auto lo = amrex::lbound_iv(bx);
436 const auto hi = amrex::ubound_iv(bx);
438 loop_detail::LoopOnCpu_impND<dim>(f, lo, hi, iv);
439}
440
441namespace loop_detail {
442
443template <int idim, typename L, int dim>
445void LoopOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
446{
447 if constexpr (idim == 1) {
448 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
450 }
451 } else if constexpr (idim == 2) {
452 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
453 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
455 }}
456 } else if constexpr (idim == 3) {
457 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
458 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
459 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
461 }}}
462 } else {
463 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
464 LoopOnCpu_impND<idim-1>(f, lo, hi, iv, n);
465 }
466 }
467}
468
469}
470
471template <class F, int dim>
473void LoopOnCpu (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
474{
475 const auto lo = amrex::lbound_iv(bx);
476 const auto hi = amrex::ubound_iv(bx);
478 for (int n = 0; n < ncomp; ++n) {
479 loop_detail::LoopOnCpu_impND<dim>(f, lo, hi, iv, n);
480 }
481}
482
483namespace loop_detail {
484
485template <int idim, typename L, int dim>
487void LoopConcurrentOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
488{
489 if constexpr (idim == 1) {
491 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
492 call_f_intvect_cpu(f,iv);
493 }
494 } else if constexpr (idim == 2) {
495 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
497 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
498 call_f_intvect_cpu(f,iv);
499 }}
500 } else if constexpr (idim == 3) {
501 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
502 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
504 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
505 call_f_intvect_cpu(f,iv);
506 }}}
507 } else {
508 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
509 LoopConcurrentOnCpu_impND<idim-1>(f, lo, hi, iv);
510 }
511 }
512}
513
514}
515
516template <class F, int dim>
518void LoopConcurrentOnCpu (BoxND<dim> const& bx, F const& f) noexcept
519{
520 const auto lo = amrex::lbound_iv(bx);
521 const auto hi = amrex::ubound_iv(bx);
523 loop_detail::LoopConcurrentOnCpu_impND<dim>(f, lo, hi, iv);
524}
525
526namespace loop_detail {
527
528template <int idim, typename L, int dim>
530void LoopConcurrentOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
531{
532 if constexpr (idim == 1) {
534 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
536 }
537 } else if constexpr (idim == 2) {
538 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
540 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
542 }}
543 } else if constexpr (idim == 3) {
544 for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
545 for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
547 for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
549 }}}
550 } else {
551 for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
552 LoopConcurrentOnCpu_impND<idim-1>(f, lo, hi, iv, n);
553 }
554 }
555}
556
557}
558
559template <class F, int dim>
561void LoopConcurrentOnCpu (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
562{
563 const auto lo = amrex::lbound_iv(bx);
564 const auto hi = amrex::ubound_iv(bx);
566 for (int n = 0; n < ncomp; ++n) {
567 loop_detail::LoopConcurrentOnCpu_impND<dim>(f, lo, hi, iv, n);
568 }
569}
570
571#include <AMReX_Loop.nolint.H>
572
573}
574
575#endif
#define AMREX_PRAGMA_SIMD
Definition AMReX_Extension.H:80
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_ATTRIBUTE_FLATTEN_FOR
Definition AMReX_Extension.H:151
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
A Rectangular Domain on an Integer Lattice.
Definition AMReX_Box.H:43
Definition AMReX_IntVect.H:48
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto call_f_intvect(F const &f, IntVectND< dim > iv) noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence< dim >(), f, iv))
Definition AMReX_Loop.H:51
AMREX_FORCE_INLINE void LoopConcurrentOnCpu_impND(L const &f, IntVectND< dim > const lo, IntVectND< dim > const hi, IntVectND< dim > iv) noexcept
Definition AMReX_Loop.H:487
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void Loop_impND(L const &f, IntVectND< dim > const lo, IntVectND< dim > const hi, IntVectND< dim > iv) noexcept
Definition AMReX_Loop.H:178
AMREX_FORCE_INLINE auto call_f_intvect_inner_cpu(std::index_sequence< Ns... >, F const &f, IntVectND< 1 > iv, Args...args) noexcept -> decltype(f(0, 0, 0, args...))
Definition AMReX_Loop.H:71
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto call_f_intvect_ncomp(F const &f, IntVectND< dim > iv, int n) noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence< dim >(), f, iv, 0))
Definition AMReX_Loop.H:61
AMREX_FORCE_INLINE auto call_f_intvect_cpu(F const &f, IntVectND< dim > iv) noexcept -> decltype(call_f_intvect_inner_cpu(std::make_index_sequence< dim >(), f, iv))
Definition AMReX_Loop.H:105
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void LoopConcurrent_impND(L const &f, IntVectND< dim > const lo, IntVectND< dim > const hi, IntVectND< dim > iv) noexcept
Definition AMReX_Loop.H:262
AMREX_FORCE_INLINE auto call_f_intvect_ncomp_cpu(F const &f, IntVectND< dim > iv, int n) noexcept -> decltype(call_f_intvect_inner_cpu(std::make_index_sequence< dim >(), f, iv, 0))
Definition AMReX_Loop.H:115
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE auto call_f_intvect_inner(std::index_sequence< Ns... >, F const &f, IntVectND< 1 > iv, Args...args) noexcept -> decltype(f(0, 0, 0, args...))
Definition AMReX_Loop.H:17
AMREX_FORCE_INLINE void LoopOnCpu_impND(L const &f, IntVectND< dim > const lo, IntVectND< dim > const hi, IntVectND< dim > iv) noexcept
Definition AMReX_Loop.H:405
Definition AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > ubound_iv(BoxND< dim > const &box) noexcept
Definition AMReX_Box.H:1789
AMREX_ATTRIBUTE_FLATTEN_FOR void LoopOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition AMReX_Loop.H:355
AMREX_ATTRIBUTE_FLATTEN_FOR void LoopConcurrentOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition AMReX_Loop.H:378
AMREX_GPU_HOST_DEVICE AMREX_ATTRIBUTE_FLATTEN_FOR void LoopConcurrent(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition AMReX_Loop.H:150
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > lbound_iv(BoxND< dim > const &box) noexcept
Definition AMReX_Box.H:1780
AMREX_GPU_HOST_DEVICE AMREX_ATTRIBUTE_FLATTEN_FOR void Loop(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition AMReX_Loop.H:125
Definition AMReX_Dim3.H:12