Block-Structured AMR Software Framework
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>
6 #include <AMReX_Extension.H>
7 
8 namespace amrex {
9 
10 namespace loop_detail {
11 
12  // call_f_intvect_inner
13 
14  template <typename F, std::size_t...Ns, class...Args>
16  auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<1> iv, Args...args)
17  noexcept -> decltype(f(0, 0, 0, args...))
18  {
19  f(iv[0], 0, 0, args...);
20  }
21 
22  template <typename F, std::size_t...Ns, class...Args>
24  auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<2> iv, Args...args)
25  noexcept -> decltype(f(0, 0, 0, args...))
26  {
27  f(iv[0], iv[1], 0, args...);
28  }
29 
30  template <typename F, int dim, std::size_t...Ns, class...Args>
32  auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
33  noexcept -> decltype(f(iv, args...))
34  {
35  f(iv, args...);
36  }
37 
38  template <typename F, int dim, std::size_t...Ns, class...Args>
40  auto call_f_intvect_inner (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
41  noexcept -> decltype(f(iv[Ns]..., args...))
42  {
43  f(iv[Ns]..., args...);
44  }
45 
46  // call_f_intvect
47 
48  template <typename F, int dim>
50  auto call_f_intvect (F const& f, IntVectND<dim> iv)
51  noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv))
52  {
53  call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv);
54  }
55 
56  // call_f_intvect_ncomp
57 
58  template <typename F, int dim>
60  auto call_f_intvect_ncomp (F const& f, IntVectND<dim> iv, int n)
61  noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv, 0))
62  {
63  call_f_intvect_inner(std::make_index_sequence<dim>(), f, iv, n);
64  }
65 
66  // call_f_intvect_inner_cpu
67 
68  template <typename F, std::size_t...Ns, class...Args>
70  auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<1> iv, Args...args)
71  noexcept -> decltype(f(0, 0, 0, args...))
72  {
73  f(iv[0], 0, 0, args...);
74  }
75 
76  template <typename F, std::size_t...Ns, class...Args>
78  auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<2> iv, Args...args)
79  noexcept -> decltype(f(0, 0, 0, args...))
80  {
81  f(iv[0], iv[1], 0, args...);
82  }
83 
84  template <typename F, int dim, std::size_t...Ns, class...Args>
86  auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
87  noexcept -> decltype(f(iv, args...))
88  {
89  f(iv, args...);
90  }
91 
92  template <typename F, int dim, std::size_t...Ns, class...Args>
94  auto call_f_intvect_inner_cpu (std::index_sequence<Ns...>, F const& f, IntVectND<dim> iv, Args...args)
95  noexcept -> decltype(f(iv[Ns]..., args...))
96  {
97  f(iv[Ns]..., args...);
98  }
99 
100  // call_f_intvect_cpu
101 
102  template <typename F, int dim>
104  auto call_f_intvect_cpu (F const& f, IntVectND<dim> iv)
105  noexcept -> decltype(call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv))
106  {
107  call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv);
108  }
109 
110  // call_f_intvect_ncomp_cpu
111 
112  template <typename F, int dim>
114  auto call_f_intvect_ncomp_cpu (F const& f, IntVectND<dim> iv, int n)
115  noexcept -> decltype(call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv, 0))
116  {
117  call_f_intvect_inner_cpu(std::make_index_sequence<dim>(), f, iv, n);
118  }
119 }
120 
121 template <class F>
124 void Loop (Dim3 lo, Dim3 hi, F const& f) noexcept
125 {
126  for (int k = lo.z; k <= hi.z; ++k) {
127  for (int j = lo.y; j <= hi.y; ++j) {
128  for (int i = lo.x; i <= hi.x; ++i) {
129  f(i,j,k);
130  }}}
131 }
132 
133 template <class F>
136 void Loop (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
137 {
138  for (int n = 0; n < ncomp; ++n) {
139  for (int k = lo.z; k <= hi.z; ++k) {
140  for (int j = lo.y; j <= hi.y; ++j) {
141  for (int i = lo.x; i <= hi.x; ++i) {
142  f(i,j,k,n);
143  }}}}
144 }
145 
146 template <class F>
149 void LoopConcurrent (Dim3 lo, Dim3 hi, F const& f) noexcept
150 {
151  for (int k = lo.z; k <= hi.z; ++k) {
152  for (int j = lo.y; j <= hi.y; ++j) {
154  for (int i = lo.x; i <= hi.x; ++i) {
155  f(i,j,k);
156  }}}
157 }
158 
159 template <class F>
162 void LoopConcurrent (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
163 {
164  for (int n = 0; n < ncomp; ++n) {
165  for (int k = lo.z; k <= hi.z; ++k) {
166  for (int j = lo.y; j <= hi.y; ++j) {
168  for (int i = lo.x; i <= hi.x; ++i) {
169  f(i,j,k,n);
170  }}}}
171 }
172 
173 namespace loop_detail {
174 
175 template <int idim, typename L, int dim>
177 void Loop_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
178 {
179  if constexpr (idim == 1) {
180  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
181  call_f_intvect(f,iv);
182  }
183  } else if constexpr (idim == 2) {
184  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
185  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
186  call_f_intvect(f,iv);
187  }}
188  } else if constexpr (idim == 3) {
189  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
190  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
191  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
192  call_f_intvect(f,iv);
193  }}}
194  } else {
195  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
196  Loop_impND<idim-1>(f, lo, hi, iv);
197  }
198  }
199 }
200 
201 }
202 
203 template <class F, int dim>
206 void Loop (BoxND<dim> const& bx, F const& f) noexcept
207 {
208  const auto lo = amrex::lbound_iv(bx);
209  const auto hi = amrex::ubound_iv(bx);
210  IntVectND<dim> iv;
211  loop_detail::Loop_impND<dim>(f, lo, hi, iv);
212 }
213 
214 namespace loop_detail {
215 
216 template <int idim, typename L, int dim>
218 void Loop_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
219 {
220  if constexpr (idim == 1) {
221  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
222  call_f_intvect_ncomp(f,iv,n);
223  }
224  } else if constexpr (idim == 2) {
225  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
226  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
227  call_f_intvect_ncomp(f,iv,n);
228  }}
229  } else if constexpr (idim == 3) {
230  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
231  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
232  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
233  call_f_intvect_ncomp(f,iv,n);
234  }}}
235  } else {
236  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
237  Loop_impND<idim-1>(f, lo, hi, iv, n);
238  }
239  }
240 }
241 
242 }
243 
244 template <class F, int dim>
247 void Loop (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
248 {
249  const auto lo = amrex::lbound_iv(bx);
250  const auto hi = amrex::ubound_iv(bx);
251  IntVectND<dim> iv;
252  for (int n = 0; n < ncomp; ++n) {
253  loop_detail::Loop_impND<dim>(f, lo, hi, iv, n);
254  }
255 }
256 
257 namespace loop_detail {
258 
259 template <int idim, typename L, int dim>
261 void LoopConcurrent_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
262 {
263  if constexpr (idim == 1) {
265  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
266  call_f_intvect(f,iv);
267  }
268  } else if constexpr (idim == 2) {
269  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
271  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
272  call_f_intvect(f,iv);
273  }}
274  } else if constexpr (idim == 3) {
275  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
276  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
278  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
279  call_f_intvect(f,iv);
280  }}}
281  } else {
282  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
283  LoopConcurrent_impND<idim-1>(f, lo, hi, iv);
284  }
285  }
286 }
287 
288 }
289 
290 template <class F, int dim>
293 void LoopConcurrent (BoxND<dim> const& bx, F const& f) noexcept
294 {
295  const auto lo = amrex::lbound_iv(bx);
296  const auto hi = amrex::ubound_iv(bx);
297  IntVectND<dim> iv;
298  loop_detail::LoopConcurrent_impND<dim>(f, lo, hi, iv);
299 }
300 
301 namespace loop_detail {
302 
303 template <int idim, typename L, int dim>
305 void LoopConcurrent_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
306 {
307  if constexpr (idim == 1) {
309  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
310  call_f_intvect_ncomp(f,iv,n);
311  }
312  } else if constexpr (idim == 2) {
313  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
315  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
316  call_f_intvect_ncomp(f,iv,n);
317  }}
318  } else if constexpr (idim == 3) {
319  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
320  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
322  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
323  call_f_intvect_ncomp(f,iv,n);
324  }}}
325  } else {
326  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
327  LoopConcurrent_impND<idim-1>(f, lo, hi, iv, n);
328  }
329  }
330 }
331 
332 }
333 
334 template <class F, int dim>
337 void LoopConcurrent (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
338 {
339  const auto lo = amrex::lbound_iv(bx);
340  const auto hi = amrex::ubound_iv(bx);
341  IntVectND<dim> iv;
342  for (int n = 0; n < ncomp; ++n) {
343  loop_detail::LoopConcurrent_impND<dim>(f, lo, hi, iv, n);
344  }
345 }
346 
347 // The functions above are __host__ __device__ functions. If f is not a
348 // __host__ __device__ function, we will get warning about calling __host__
349 // function from a __host__ __device__ function. This is ugly. To get rid
350 // of the warning, we have to use the functions below for those situations.
351 
352 template <class F>
354 void LoopOnCpu (Dim3 lo, Dim3 hi, F const& f) noexcept
355 {
356  for (int k = lo.z; k <= hi.z; ++k) {
357  for (int j = lo.y; j <= hi.y; ++j) {
358  for (int i = lo.x; i <= hi.x; ++i) {
359  f(i,j,k);
360  }}}
361 }
362 
363 template <class F>
365 void LoopOnCpu (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
366 {
367  for (int n = 0; n < ncomp; ++n) {
368  for (int k = lo.z; k <= hi.z; ++k) {
369  for (int j = lo.y; j <= hi.y; ++j) {
370  for (int i = lo.x; i <= hi.x; ++i) {
371  f(i,j,k,n);
372  }}}}
373 }
374 
375 template <class F>
377 void LoopConcurrentOnCpu (Dim3 lo, Dim3 hi, F const& f) noexcept
378 {
379  for (int k = lo.z; k <= hi.z; ++k) {
380  for (int j = lo.y; j <= hi.y; ++j) {
382  for (int i = lo.x; i <= hi.x; ++i) {
383  f(i,j,k);
384  }}}
385 }
386 
387 template <class F>
389 void LoopConcurrentOnCpu (Dim3 lo, Dim3 hi, int ncomp, F const& f) noexcept
390 {
391  for (int n = 0; n < ncomp; ++n) {
392  for (int k = lo.z; k <= hi.z; ++k) {
393  for (int j = lo.y; j <= hi.y; ++j) {
395  for (int i = lo.x; i <= hi.x; ++i) {
396  f(i,j,k,n);
397  }}}}
398 }
399 
400 namespace loop_detail {
401 
402 template <int idim, typename L, int dim>
404 void LoopOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
405 {
406  if constexpr (idim == 1) {
407  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
408  call_f_intvect_cpu(f,iv);
409  }
410  } else if constexpr (idim == 2) {
411  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
412  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
413  call_f_intvect_cpu(f,iv);
414  }}
415  } else if constexpr (idim == 3) {
416  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
417  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
418  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
419  call_f_intvect_cpu(f,iv);
420  }}}
421  } else {
422  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
423  LoopOnCpu_impND<idim-1>(f, lo, hi, iv);
424  }
425  }
426 }
427 
428 }
429 
430 template <class F, int dim>
432 void LoopOnCpu (BoxND<dim> const& bx, F const& f) noexcept
433 {
434  const auto lo = amrex::lbound_iv(bx);
435  const auto hi = amrex::ubound_iv(bx);
436  IntVectND<dim> iv;
437  loop_detail::LoopOnCpu_impND<dim>(f, lo, hi, iv);
438 }
439 
440 namespace loop_detail {
441 
442 template <int idim, typename L, int dim>
444 void LoopOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
445 {
446  if constexpr (idim == 1) {
447  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
449  }
450  } else if constexpr (idim == 2) {
451  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
452  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
454  }}
455  } else if constexpr (idim == 3) {
456  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
457  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
458  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
460  }}}
461  } else {
462  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
463  LoopOnCpu_impND<idim-1>(f, lo, hi, iv, n);
464  }
465  }
466 }
467 
468 }
469 
470 template <class F, int dim>
472 void LoopOnCpu (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
473 {
474  const auto lo = amrex::lbound_iv(bx);
475  const auto hi = amrex::ubound_iv(bx);
476  IntVectND<dim> iv;
477  for (int n = 0; n < ncomp; ++n) {
478  loop_detail::LoopOnCpu_impND<dim>(f, lo, hi, iv, n);
479  }
480 }
481 
482 namespace loop_detail {
483 
484 template <int idim, typename L, int dim>
486 void LoopConcurrentOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv) noexcept
487 {
488  if constexpr (idim == 1) {
490  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
491  call_f_intvect_cpu(f,iv);
492  }
493  } else if constexpr (idim == 2) {
494  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
496  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
497  call_f_intvect_cpu(f,iv);
498  }}
499  } else if constexpr (idim == 3) {
500  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
501  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
503  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
504  call_f_intvect_cpu(f,iv);
505  }}}
506  } else {
507  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
508  LoopConcurrentOnCpu_impND<idim-1>(f, lo, hi, iv);
509  }
510  }
511 }
512 
513 }
514 
515 template <class F, int dim>
517 void LoopConcurrentOnCpu (BoxND<dim> const& bx, F const& f) noexcept
518 {
519  const auto lo = amrex::lbound_iv(bx);
520  const auto hi = amrex::ubound_iv(bx);
521  IntVectND<dim> iv;
522  loop_detail::LoopConcurrentOnCpu_impND<dim>(f, lo, hi, iv);
523 }
524 
525 namespace loop_detail {
526 
527 template <int idim, typename L, int dim>
529 void LoopConcurrentOnCpu_impND (L const& f, IntVectND<dim> const lo, IntVectND<dim> const hi, IntVectND<dim> iv, int n) noexcept
530 {
531  if constexpr (idim == 1) {
533  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
535  }
536  } else if constexpr (idim == 2) {
537  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
539  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
541  }}
542  } else if constexpr (idim == 3) {
543  for (int i2 = lo[2], h2 = hi[2]; i2 <= h2; ++i2) { iv[2] = i2;
544  for (int i1 = lo[1], h1 = hi[1]; i1 <= h1; ++i1) { iv[1] = i1;
546  for (int i0 = lo[0], h0 = hi[0]; i0 <= h0; ++i0) { iv[0] = i0;
548  }}}
549  } else {
550  for (int id = lo[idim-1], hd = hi[idim-1]; id <= hd; ++id) { iv[idim-1] = id;
551  LoopConcurrentOnCpu_impND<idim-1>(f, lo, hi, iv, n);
552  }
553  }
554 }
555 
556 }
557 
558 template <class F, int dim>
560 void LoopConcurrentOnCpu (BoxND<dim> const& bx, int ncomp, F const& f) noexcept
561 {
562  const auto lo = amrex::lbound_iv(bx);
563  const auto hi = amrex::ubound_iv(bx);
564  IntVectND<dim> iv;
565  for (int n = 0; n < ncomp; ++n) {
566  loop_detail::LoopConcurrentOnCpu_impND<dim>(f, lo, hi, iv, n);
567  }
568 }
569 
570 // Implementation of "constexpr for" based on
571 // https://artificial-mind.net/blog/2020/10/31/constexpr-for
572 //
573 // Approximates what one would get from a compile-time
574 // unrolling of the loop
575 // for (int i = 0; i < N; ++i) {
576 // f(i);
577 // }
578 //
579 // The mechanism is recursive: we evaluate f(i) at the current
580 // i and then call the for loop at i+1. f() is a lambda function
581 // that provides the body of the loop and takes only an integer
582 // i as its argument.
583 
584 template<auto I, auto N, class F>
586 constexpr void constexpr_for (F const& f)
587 {
588  if constexpr (I < N) {
589  f(std::integral_constant<decltype(I), I>());
590  constexpr_for<I+1, N>(f);
591  }
592 }
593 
594 #include <AMReX_Loop.nolint.H>
595 
596 }
597 
598 #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_INLINE
Definition: AMReX_Extension.H:127
#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
static int f(amrex::Real t, N_Vector y_data, N_Vector y_rhs, void *user_data)
Definition: AMReX_SundialsIntegrator.H:44
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:50
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:486
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:177
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:70
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:60
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:104
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:261
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:114
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:16
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:404
Definition: AMReX_Amr.cpp:49
AMREX_GPU_HOST_DEVICE constexpr AMREX_INLINE void constexpr_for(F const &f)
Definition: AMReX_Loop.H:586
AMREX_ATTRIBUTE_FLATTEN_FOR void LoopOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:354
AMREX_ATTRIBUTE_FLATTEN_FOR void LoopConcurrentOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:377
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE IntVectND< dim > ubound_iv(BoxND< dim > const &box) noexcept
Definition: AMReX_Box.H:1789
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 LoopConcurrent(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:149
AMREX_GPU_HOST_DEVICE AMREX_ATTRIBUTE_FLATTEN_FOR void Loop(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition: AMReX_Loop.H:124
Definition: AMReX_Dim3.H:12