1#ifndef AMREX_GPU_LAUNCH_FUNCTS_G_H_
2#define AMREX_GPU_LAUNCH_FUNCTS_G_H_
3#include <AMReX_Config.H>
11 template <
typename F,
typename N>
14 noexcept ->
decltype(f(0))
19 template <
typename F,
typename N>
29 template <
typename F, std::size_t...Ns,
class...Args>
32 noexcept -> decltype(f(0, 0, 0, args...))
34 f(iv[0], 0, 0, args...);
37 template <
typename F, std::size_t...Ns,
class...Args>
40 noexcept -> decltype(f(0, 0, 0, args...))
42 f(iv[0], iv[1], 0, args...);
45 template <
typename F,
int dim, std::size_t...Ns,
class...Args>
48 noexcept -> decltype(f(iv, args...))
53 template <
typename F,
int dim, std::size_t...Ns,
class...Args>
56 noexcept -> decltype(f(iv[Ns]..., args...))
58 f(iv[Ns]..., args...);
63 template <
typename F,
int dim>
73 template <
typename F,
int dim>
83 template <
typename F,
int dim>
91 template <
typename F,
int dim>
101 template <
typename F,
typename T,
int dim>
106 for (T n = 0; n < ncomp; ++n) {
113 template <
typename F,
typename T,
int dim>
118 for (T n = 0; n < ncomp; ++n) {
125 template <
typename F,
typename T,
int dim>
130 for (T n = 0; n < ncomp; ++n) {
135 template <
typename F,
typename T,
int dim>
140 for (T n = 0; n < ncomp; ++n) {
152 auto& q = *(stream.queue);
154 q.submit([&] (sycl::handler& h) {
155 h.single_task([=] () { f(); });
157 }
catch (sycl::exception
const& ex) {
158 amrex::Abort(std::string(
"single_task: ")+ex.what()+
"!!!!!");
163void launch (
int nblocks,
int nthreads_per_block, std::size_t shared_mem_bytes,
166 const auto nthreads_total = std::size_t(nthreads_per_block) * nblocks;
167 const std::size_t shared_mem_numull = (shared_mem_bytes+
sizeof(
unsigned long long)-1)
168 /
sizeof(
unsigned long long);
169 auto& q = *(stream.queue);
171 q.submit([&] (sycl::handler& h) {
172 sycl::local_accessor<unsigned long long>
173 shared_data(sycl::range<1>(shared_mem_numull), h);
174 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
175 sycl::range<1>(nthreads_per_block)),
176 [=] (sycl::nd_item<1> item)
179 f(Gpu::Handler{&item,shared_data.get_multi_ptr<sycl::access::decorated::yes>().
get()});
182 }
catch (sycl::exception
const& ex) {
183 amrex::Abort(std::string(
"launch: ")+ex.what()+
"!!!!!");
188void launch (
int nblocks,
int nthreads_per_block,
gpuStream_t stream, L
const& f)
noexcept
190 const auto nthreads_total = std::size_t(nthreads_per_block) * nblocks;
191 auto& q = *(stream.queue);
193 q.submit([&] (sycl::handler& h) {
194 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
195 sycl::range<1>(nthreads_per_block)),
196 [=] (sycl::nd_item<1> item)
202 }
catch (sycl::exception
const& ex) {
203 amrex::Abort(std::string(
"launch: ")+ex.what()+
"!!!!!");
207template <
int MT,
typename L>
211 const auto nthreads_total = MT * std::size_t(nblocks);
212 const std::size_t shared_mem_numull = (shared_mem_bytes+
sizeof(
unsigned long long)-1)
213 /
sizeof(
unsigned long long);
214 auto& q = *(stream.queue);
216 q.submit([&] (sycl::handler& h) {
217 sycl::local_accessor<unsigned long long>
218 shared_data(sycl::range<1>(shared_mem_numull), h);
219 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
221 [=] (sycl::nd_item<1> item)
222 [[sycl::reqd_work_group_size(MT)]]
225 f(Gpu::Handler{&item,shared_data.get_multi_ptr<sycl::access::decorated::yes>().
get()});
228 }
catch (sycl::exception
const& ex) {
229 amrex::Abort(std::string(
"launch: ")+ex.what()+
"!!!!!");
233template <
int MT,
typename L>
236 const auto nthreads_total = MT * std::size_t(nblocks);
237 auto& q = *(stream.queue);
239 q.submit([&] (sycl::handler& h) {
240 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
242 [=] (sycl::nd_item<1> item)
243 [[sycl::reqd_work_group_size(MT)]]
249 }
catch (sycl::exception
const& ex) {
250 amrex::Abort(std::string(
"launch: ")+ex.what()+
"!!!!!");
254template<
int MT,
typename T,
typename L>
255void launch (T
const& n, L
const& f)
noexcept
258 const auto ec = Gpu::makeExecutionConfig<MT>(n);
259 const auto nthreads_per_block = ec.numThreads.x;
260 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
261 auto& q = Gpu::Device::streamQueue();
263 q.submit([&] (sycl::handler& h) {
264 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
265 sycl::range<1>(nthreads_per_block)),
266 [=] (sycl::nd_item<1> item)
267 [[sycl::reqd_work_group_size(MT)]]
270 for (
auto const i :
Gpu::
Range(n,item.get_global_id(0),item.get_global_range(0))) {
275 }
catch (sycl::exception
const& ex) {
276 amrex::Abort(std::string(
"launch: ")+ex.what()+
"!!!!!");
280template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
281void ParallelFor (Gpu::KernelInfo
const& info, T n, L
const& f)
noexcept
284 const auto ec = Gpu::makeExecutionConfig<MT>(n);
285 const auto nthreads_per_block = ec.numThreads.x;
286 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
287 auto& q = Gpu::Device::streamQueue();
289 if (info.hasReduction()) {
290 q.submit([&] (sycl::handler& h) {
291 sycl::local_accessor<unsigned long long>
293 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
294 sycl::range<1>(nthreads_per_block)),
295 [=] (sycl::nd_item<1> item)
296 [[sycl::reqd_work_group_size(MT)]]
299 for (std::size_t i = item.get_global_id(0), stride = item.get_global_range(0);
300 i < std::size_t(n); i += stride) {
301 int n_active_threads =
amrex::min(std::size_t(n)-i+item.get_local_id(0),
302 item.get_local_range(0));
309 q.submit([&] (sycl::handler& h) {
310 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
311 sycl::range<1>(nthreads_per_block)),
312 [=] (sycl::nd_item<1> item)
313 [[sycl::reqd_work_group_size(MT)]]
316 for (std::size_t i = item.get_global_id(0), stride = item.get_global_range(0);
317 i < std::size_t(n); i += stride) {
323 }
catch (sycl::exception
const& ex) {
324 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
328template <
int MT,
typename L,
int dim>
329void ParallelFor (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, L
const& f)
noexcept
332 const BoxIndexerND<dim> indexer(box);
333 const auto ec = Gpu::makeExecutionConfig<MT>(box.numPts());
334 const auto nthreads_per_block = ec.numThreads.x;
335 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
336 auto& q = Gpu::Device::streamQueue();
338 if (info.hasReduction()) {
339 q.submit([&] (sycl::handler& h) {
340 sycl::local_accessor<unsigned long long>
342 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
343 sycl::range<1>(nthreads_per_block)),
344 [=] (sycl::nd_item<1> item)
345 [[sycl::reqd_work_group_size(MT)]]
348 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
349 icell < indexer.numPts(); icell += stride) {
350 auto iv = indexer.intVect(icell);
351 int n_active_threads =
amrex::min(indexer.numPts()-icell+std::uint64_t(item.get_local_id(0)),
352 std::uint64_t(item.get_local_range(0)));
359 q.submit([&] (sycl::handler& h) {
360 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
361 sycl::range<1>(nthreads_per_block)),
362 [=] (sycl::nd_item<1> item)
363 [[sycl::reqd_work_group_size(MT)]]
366 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
367 icell < indexer.numPts(); icell += stride) {
368 auto iv = indexer.intVect(icell);
374 }
catch (sycl::exception
const& ex) {
375 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
379template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
380void ParallelFor (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, T ncomp, L
const& f)
noexcept
383 const BoxIndexerND<dim> indexer(box);
384 const auto ec = Gpu::makeExecutionConfig<MT>(box.numPts());
385 const auto nthreads_per_block = ec.numThreads.x;
386 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
387 auto& q = Gpu::Device::streamQueue();
389 if (info.hasReduction()) {
390 q.submit([&] (sycl::handler& h) {
391 sycl::local_accessor<unsigned long long>
393 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
394 sycl::range<1>(nthreads_per_block)),
395 [=] (sycl::nd_item<1> item)
396 [[sycl::reqd_work_group_size(MT)]]
399 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
400 icell < indexer.numPts(); icell += stride) {
401 auto iv = indexer.intVect(icell);
402 int n_active_threads =
amrex::min(indexer.numPts()-icell+std::uint64_t(item.get_local_id(0)),
403 std::uint64_t(item.get_local_range(0)));
405 Gpu::Handler{&item, shared_data.get_multi_ptr<sycl::access::decorated::yes>().
get(),
411 q.submit([&] (sycl::handler& h) {
412 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
413 sycl::range<1>(nthreads_per_block)),
414 [=] (sycl::nd_item<1> item)
415 [[sycl::reqd_work_group_size(MT)]]
418 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
419 icell < indexer.numPts(); icell += stride) {
420 auto iv = indexer.intVect(icell);
426 }
catch (sycl::exception
const& ex) {
427 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
431template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
435 const auto ec = Gpu::ExecutionConfig(n);
436 const auto nthreads_per_block = ec.numThreads.x;
438 auto& q = Gpu::Device::streamQueue();
439 auto& engdescr = *(getRandEngineDescriptor());
441 q.submit([&] (sycl::handler& h) {
442 auto engine_acc = engdescr.get_access(h);
443 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
444 sycl::range<1>(nthreads_per_block)),
445 [=] (sycl::nd_item<1> item)
446 [[sycl::reqd_work_group_size(AMREX_GPU_MAX_THREADS)]]
449 auto const tid = item.get_global_id(0);
450 auto engine = engine_acc.load(tid);
451 RandomEngine rand_eng{&engine};
452 for (std::size_t i = tid, stride = item.get_global_range(0); i < std::size_t(n); i += stride) {
455 engine_acc.store(engine, tid);
459 }
catch (sycl::exception
const& ex) {
460 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
464template <
typename L,
int dim>
468 const BoxIndexerND<dim> indexer(box);
469 const auto ec = Gpu::ExecutionConfig(box.numPts());
470 const auto nthreads_per_block = ec.numThreads.x;
472 auto& q = Gpu::Device::streamQueue();
473 auto& engdescr = *(getRandEngineDescriptor());
475 q.submit([&] (sycl::handler& h) {
476 auto engine_acc = engdescr.get_access(h);
477 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
478 sycl::range<1>(nthreads_per_block)),
479 [=] (sycl::nd_item<1> item)
480 [[sycl::reqd_work_group_size(AMREX_GPU_MAX_THREADS)]]
483 auto const tid = item.get_global_id(0);
484 auto engine = engine_acc.load(tid);
485 RandomEngine rand_eng{&engine};
486 for (std::uint64_t icell = tid, stride = item.get_global_range(0);
487 icell < indexer.numPts(); icell += stride) {
488 auto iv = indexer.intVect(icell);
491 engine_acc.store(engine, tid);
495 }
catch (sycl::exception
const& ex) {
496 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
500template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
501void ParallelForRNG (BoxND<dim>
const& box, T ncomp, L
const& f)
noexcept
504 const BoxIndexerND<dim> indexer(box);
505 const auto ec = Gpu::ExecutionConfig(box.numPts());
506 const auto nthreads_per_block = ec.numThreads.x;
508 auto& q = Gpu::Device::streamQueue();
509 auto& engdescr = *(getRandEngineDescriptor());
511 q.submit([&] (sycl::handler& h) {
512 auto engine_acc = engdescr.get_access(h);
513 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
514 sycl::range<1>(nthreads_per_block)),
515 [=] (sycl::nd_item<1> item)
516 [[sycl::reqd_work_group_size(AMREX_GPU_MAX_THREADS)]]
519 auto const tid = item.get_global_id(0);
520 auto engine = engine_acc.load(tid);
521 RandomEngine rand_eng{&engine};
522 for (std::uint64_t icell = tid, stride = item.get_global_range(0);
523 icell < indexer.numPts(); icell += stride) {
524 auto iv = indexer.intVect(icell);
527 engine_acc.store(engine, tid);
531 }
catch (sycl::exception
const& ex) {
532 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
536template <
int MT,
typename L1,
typename L2,
int dim>
537void ParallelFor (Gpu::KernelInfo
const& , BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
540 const BoxIndexerND<dim> indexer1(box1);
541 const BoxIndexerND<dim> indexer2(box2);
542 const auto ec = Gpu::makeExecutionConfig<MT>(std::max(box1.numPts(), box2.numPts()));
543 const auto nthreads_per_block = ec.numThreads.x;
544 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
545 auto& q = Gpu::Device::streamQueue();
547 q.submit([&] (sycl::handler& h) {
548 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
549 sycl::range<1>(nthreads_per_block)),
550 [=] (sycl::nd_item<1> item)
551 [[sycl::reqd_work_group_size(MT)]]
554 auto const ncells = std::max(indexer1.numPts(), indexer2.numPts());
555 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
556 icell < ncells; icell += stride) {
557 if (icell < indexer1.numPts()) {
558 auto iv = indexer1.intVect(icell);
561 if (icell < indexer2.numPts()) {
562 auto iv = indexer2.intVect(icell);
568 }
catch (sycl::exception
const& ex) {
569 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
573template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
575 BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
576 L1&& f1, L2&& f2, L3&& f3)
noexcept
579 const BoxIndexerND<dim> indexer1(box1);
580 const BoxIndexerND<dim> indexer2(box2);
581 const BoxIndexerND<dim> indexer3(box3);
582 const auto ec = Gpu::makeExecutionConfig<MT>(std::max({box1.numPts(),box2.numPts(),box3.numPts()}));
583 const auto nthreads_per_block = ec.numThreads.x;
584 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
585 auto& q = Gpu::Device::streamQueue();
587 q.submit([&] (sycl::handler& h) {
588 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
589 sycl::range<1>(nthreads_per_block)),
590 [=] (sycl::nd_item<1> item)
591 [[sycl::reqd_work_group_size(MT)]]
594 auto const ncells =
amrex::max(indexer1.numPts(), indexer2.numPts(), indexer3.numPts());
595 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
596 icell < ncells; icell += stride) {
597 if (icell < indexer1.numPts()) {
598 auto iv = indexer1.intVect(icell);
601 if (icell < indexer2.numPts()) {
602 auto iv = indexer2.intVect(icell);
605 if (icell < indexer3.numPts()) {
606 auto iv = indexer3.intVect(icell);
612 }
catch (sycl::exception
const& ex) {
613 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
617template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
618 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
619 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
621 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
622 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
625 const BoxIndexerND<dim> indexer1(box1);
626 const BoxIndexerND<dim> indexer2(box2);
627 const auto ec = Gpu::makeExecutionConfig<MT>(std::max(box1.numPts(),box2.numPts()));
628 const auto nthreads_per_block = ec.numThreads.x;
629 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
630 auto& q = Gpu::Device::streamQueue();
632 q.submit([&] (sycl::handler& h) {
633 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
634 sycl::range<1>(nthreads_per_block)),
635 [=] (sycl::nd_item<1> item)
636 [[sycl::reqd_work_group_size(MT)]]
639 auto const ncells = std::max(indexer1.numPts(), indexer2.numPts());
640 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
641 icell < ncells; icell += stride) {
642 if (icell < indexer1.numPts()) {
643 auto iv = indexer1.intVect(icell);
646 if (icell < indexer2.numPts()) {
647 auto iv = indexer2.intVect(icell);
653 }
catch (sycl::exception
const& ex) {
654 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
658template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
659 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
660 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
661 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
663 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
664 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
665 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
668 const BoxIndexerND<dim> indexer1(box1);
669 const BoxIndexerND<dim> indexer2(box2);
670 const BoxIndexerND<dim> indexer3(box3);
671 const auto ec = Gpu::makeExecutionConfig<MT>(std::max({box1.numPts(),box2.numPts(),box3.numPts()}));
672 const auto nthreads_per_block = ec.numThreads.x;
673 const auto nthreads_total = std::size_t(nthreads_per_block) * ec.numBlocks.x;
674 auto& q = Gpu::Device::streamQueue();
676 q.submit([&] (sycl::handler& h) {
677 h.parallel_for(sycl::nd_range<1>(sycl::range<1>(nthreads_total),
678 sycl::range<1>(nthreads_per_block)),
679 [=] (sycl::nd_item<1> item)
680 [[sycl::reqd_work_group_size(MT)]]
683 auto const ncells =
amrex::max(indexer1.numPts(), indexer2.numPts(), indexer3.numPts());
684 for (std::uint64_t icell = item.get_global_id(0), stride = item.get_global_range(0);
685 icell < ncells; icell += stride) {
686 if (icell < indexer1.numPts()) {
687 auto iv = indexer1.intVect(icell);
690 if (icell < indexer2.numPts()) {
691 auto iv = indexer2.intVect(icell);
694 if (icell < indexer3.numPts()) {
695 auto iv = indexer3.intVect(icell);
701 }
catch (sycl::exception
const& ex) {
702 amrex::Abort(std::string(
"ParallelFor: ")+ex.what()+
"!!!!!");
717template <
int MT,
typename L>
726template <
int MT,
typename L>
735void launch (
int nblocks,
int nthreads_per_block, std::size_t shared_mem_bytes,
746 launch(nblocks, nthreads_per_block, 0, stream, std::forward<L>(f));
749template<
int MT,
typename T,
typename L, std::enable_if_t<std::is_
integral_v<T>,
int> FOO = 0>
750void launch (T
const& n, L
const& f)
noexcept
752 static_assert(
sizeof(T) >= 2);
754 const auto& nec = Gpu::makeNExecutionConfigs<MT>(n);
755 for (
auto const& ec : nec) {
756 const T start_idx = T(ec.start_idx);
757 const T nleft = n - start_idx;
761 auto tid = T(MT)*T(blockIdx.x)+T(threadIdx.x);
770template<
int MT,
int dim,
typename L>
773 if (box.isEmpty()) {
return; }
774 const auto& nec = Gpu::makeNExecutionConfigs<MT>(box);
776 const auto type = box.ixType();
777 for (
auto const& ec : nec) {
778 const auto start_idx = std::uint64_t(ec.start_idx);
781 auto icell = std::uint64_t(MT)*blockIdx.x+threadIdx.x + start_idx;
782 if (icell < indexer.
numPts()) {
783 auto iv = indexer.
intVect(icell);
791template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
792std::enable_if_t<MaybeDeviceRunnable<L>::value>
795 static_assert(
sizeof(T) >= 2);
797 const auto& nec = Gpu::makeNExecutionConfigs<MT>(n);
798 for (
auto const& ec : nec) {
799 const T start_idx = T(ec.start_idx);
800 const T nleft = n - start_idx;
804 auto tid = T(MT)*T(blockIdx.x)+T(threadIdx.x);
808 (std::uint64_t)MT)));
815template <
int MT,
typename L,
int dim>
816std::enable_if_t<MaybeDeviceRunnable<L>::value>
821 const auto& nec = Gpu::makeNExecutionConfigs<MT>(box);
822 for (
auto const& ec : nec) {
823 const auto start_idx = std::uint64_t(ec.start_idx);
826 auto icell = std::uint64_t(MT)*blockIdx.x+threadIdx.x + start_idx;
827 if (icell < indexer.
numPts()) {
828 auto iv = indexer.
intVect(icell);
831 (std::uint64_t)MT)));
838template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
839std::enable_if_t<MaybeDeviceRunnable<L>::value>
844 const auto& nec = Gpu::makeNExecutionConfigs<MT>(box);
845 for (
auto const& ec : nec) {
846 const auto start_idx = std::uint64_t(ec.start_idx);
849 auto icell = std::uint64_t(MT)*blockIdx.x+threadIdx.x + start_idx;
850 if (icell < indexer.
numPts()) {
851 auto iv = indexer.
intVect(icell);
854 (std::uint64_t)MT)));
861template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
862std::enable_if_t<MaybeDeviceRunnable<L>::value>
872 Long tid = Long(AMREX_GPU_MAX_THREADS)*blockIdx.x+threadIdx.x;
874 for (Long i = tid, stride = Long(AMREX_GPU_MAX_THREADS)*gridDim.x; i < Long(n); i += stride) {
882template <
typename L,
int dim>
883std::enable_if_t<MaybeDeviceRunnable<L>::value>
894 auto const tid = std::uint64_t(AMREX_GPU_MAX_THREADS)*blockIdx.x+threadIdx.x;
896 for (std::uint64_t icell = tid, stride = std::uint64_t(AMREX_GPU_MAX_THREADS)*gridDim.x; icell < indexer.
numPts(); icell += stride) {
897 auto iv = indexer.
intVect(icell);
905template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
906std::enable_if_t<MaybeDeviceRunnable<L>::value>
917 auto const tid = std::uint64_t(AMREX_GPU_MAX_THREADS)*blockIdx.x+threadIdx.x;
919 for (std::uint64_t icell = tid, stride = std::uint64_t(AMREX_GPU_MAX_THREADS)*gridDim.x; icell < indexer.
numPts(); icell += stride) {
920 auto iv = indexer.
intVect(icell);
928template <
int MT,
typename L1,
typename L2,
int dim>
929std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value>
936 const auto ec = Gpu::makeExecutionConfig<MT>(std::max(box1.numPts(),box2.numPts()));
939 auto const ncells = std::max(indexer1.
numPts(), indexer2.
numPts());
940 for (std::uint64_t icell = std::uint64_t(MT)*blockIdx.x+threadIdx.x, stride = std::uint64_t(MT)*gridDim.x;
941 icell < ncells; icell += stride) {
942 if (icell < indexer1.
numPts()) {
943 auto iv = indexer1.
intVect(icell);
946 if (icell < indexer2.
numPts()) {
947 auto iv = indexer2.
intVect(icell);
955template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
956std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value && MaybeDeviceRunnable<L3>::value>
959 L1&& f1, L2&& f2, L3&& f3)
noexcept
965 const auto ec = Gpu::makeExecutionConfig<MT>(std::max({box1.numPts(),box2.numPts(),box3.numPts()}));
968 auto const ncells = std::max({indexer1.
numPts(), indexer2.
numPts(), indexer3.
numPts()});
969 for (std::uint64_t icell = std::uint64_t(MT)*blockIdx.x+threadIdx.x, stride = std::uint64_t(MT)*gridDim.x;
970 icell < ncells; icell += stride) {
971 if (icell < indexer1.
numPts()) {
972 auto iv = indexer1.
intVect(icell);
975 if (icell < indexer2.
numPts()) {
976 auto iv = indexer2.
intVect(icell);
979 if (icell < indexer3.
numPts()) {
980 auto iv = indexer3.
intVect(icell);
988template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
989 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
990 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
991std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value>
994 BoxND<dim> const& box2, T2 ncomp2, L2&& f2)
noexcept
999 const auto ec = Gpu::makeExecutionConfig<MT>(std::max(box1.numPts(),box2.numPts()));
1002 auto const ncells = std::max(indexer1.
numPts(), indexer2.
numPts());
1003 for (std::uint64_t icell = std::uint64_t(MT)*blockIdx.x+threadIdx.x, stride = std::uint64_t(MT)*gridDim.x;
1004 icell < ncells; icell += stride) {
1005 if (icell < indexer1.
numPts()) {
1006 auto iv = indexer1.
intVect(icell);
1009 if (icell < indexer2.
numPts()) {
1010 auto iv = indexer2.
intVect(icell);
1018template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1019 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1020 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1021 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1022std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value && MaybeDeviceRunnable<L3>::value>
1026 BoxND<dim> const& box3, T3 ncomp3, L3&& f3)
noexcept
1032 const auto ec = Gpu::makeExecutionConfig<MT>(std::max({box1.numPts(),box2.numPts(),box3.numPts()}));
1035 auto const ncells = std::max({indexer1.
numPts(), indexer2.
numPts(), indexer3.
numPts()});
1036 for (std::uint64_t icell = std::uint64_t(MT)*blockIdx.x+threadIdx.x, stride = std::uint64_t(MT)*gridDim.x;
1037 icell < ncells; icell += stride) {
1038 if (icell < indexer1.
numPts()) {
1039 auto iv = indexer1.
intVect(icell);
1042 if (icell < indexer2.
numPts()) {
1043 auto iv = indexer2.
intVect(icell);
1046 if (icell < indexer3.
numPts()) {
1047 auto iv = indexer3.
intVect(icell);
1057template <
typename L>
1063template<
typename T,
typename L>
1064void launch (T
const& n, L&& f)
noexcept
1066 launch<AMREX_GPU_MAX_THREADS>(n, std::forward<L>(f));
1069template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1070std::enable_if_t<MaybeDeviceRunnable<L>::value>
1073 ParallelFor<AMREX_GPU_MAX_THREADS>(info, n, std::forward<L>(f));
1076template <
typename L,
int dim>
1077std::enable_if_t<MaybeDeviceRunnable<L>::value>
1080 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box, std::forward<L>(f));
1083template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1084std::enable_if_t<MaybeDeviceRunnable<L>::value>
1087 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box, ncomp, std::forward<L>(f));
1090template <
typename L1,
typename L2,
int dim>
1091std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value>
1095 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box1, box2, std::forward<L1>(f1),
1096 std::forward<L2>(f2));
1099template <
typename L1,
typename L2,
typename L3,
int dim>
1100std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value && MaybeDeviceRunnable<L3>::value>
1103 L1&& f1, L2&& f2, L3&& f3)
noexcept
1105 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box1, box2, box3, std::forward<L1>(f1),
1106 std::forward<L2>(f2), std::forward<L3>(f3));
1109template <
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1110 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1111 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1112std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value>
1115 BoxND<dim> const& box2, T2 ncomp2, L2&& f2)
noexcept
1117 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box1, ncomp1, std::forward<L1>(f1),
1118 box2, ncomp2, std::forward<L2>(f2));
1121template <
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1122 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1123 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1124 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1125std::enable_if_t<MaybeDeviceRunnable<L1>::value && MaybeDeviceRunnable<L2>::value && MaybeDeviceRunnable<L3>::value>
1129 BoxND<dim> const& box3, T3 ncomp3, L3&& f3)
noexcept
1131 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box1, ncomp1, std::forward<L1>(f1),
1132 box2, ncomp2, std::forward<L2>(f2),
1133 box3, ncomp3, std::forward<L3>(f3));
1136template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1137void For (Gpu::KernelInfo
const& info, T n, L&& f)
noexcept
1139 ParallelFor<AMREX_GPU_MAX_THREADS>(info, n,std::forward<L>(f));
1142template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1143void For (Gpu::KernelInfo
const& info, T n, L&& f)
noexcept
1145 ParallelFor<MT>(info, n,std::forward<L>(f));
1148template <
typename L,
int dim>
1149void For (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, L&& f)
noexcept
1151 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box,std::forward<L>(f));
1154template <
int MT,
typename L,
int dim>
1155void For (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, L&& f)
noexcept
1157 ParallelFor<MT>(info, box,std::forward<L>(f));
1160template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1161void For (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, T ncomp, L&& f)
noexcept
1163 ParallelFor<AMREX_GPU_MAX_THREADS>(info,box,ncomp,std::forward<L>(f));
1166template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1167void For (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, T ncomp, L&& f)
noexcept
1169 ParallelFor<MT>(info,box,ncomp,std::forward<L>(f));
1172template <
typename L1,
typename L2,
int dim>
1173void For (Gpu::KernelInfo
const& info,
1174 BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1176 ParallelFor<AMREX_GPU_MAX_THREADS>(info,box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1179template <
int MT,
typename L1,
typename L2,
int dim>
1180void For (Gpu::KernelInfo
const& info,
1181 BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1183 ParallelFor<MT>(info,box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1186template <
typename L1,
typename L2,
typename L3,
int dim>
1187void For (Gpu::KernelInfo
const& info,
1188 BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1189 L1&& f1, L2&& f2, L3&& f3)
noexcept
1191 ParallelFor<AMREX_GPU_MAX_THREADS>(info,box1,box2,box3,std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1194template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
1195void For (Gpu::KernelInfo
const& info,
1196 BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1197 L1&& f1, L2&& f2, L3&& f3)
noexcept
1199 ParallelFor<MT>(info,box1,box2,box3,std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1202template <
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1203 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1204 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1205void For (Gpu::KernelInfo
const& info,
1206 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1207 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1209 ParallelFor<AMREX_GPU_MAX_THREADS>(info,box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1212template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1213 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1214 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1215void For (Gpu::KernelInfo
const& info,
1216 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1217 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1219 ParallelFor<MT>(info,box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1222template <
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1223 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1224 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1225 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1226void For (Gpu::KernelInfo
const& info,
1227 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1228 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1229 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1231 ParallelFor<AMREX_GPU_MAX_THREADS>(info,
1232 box1,ncomp1,std::forward<L1>(f1),
1233 box2,ncomp2,std::forward<L2>(f2),
1234 box3,ncomp3,std::forward<L3>(f3));
1237template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1238 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1239 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1240 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1241void For (Gpu::KernelInfo
const& info,
1242 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1243 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1244 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1246 ParallelFor<MT>(info,
1247 box1,ncomp1,std::forward<L1>(f1),
1248 box2,ncomp2,std::forward<L2>(f2),
1249 box3,ncomp3,std::forward<L3>(f3));
1252template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1255 ParallelFor<AMREX_GPU_MAX_THREADS>(
Gpu::KernelInfo{}, n, std::forward<L>(f));
1258template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1259void ParallelFor (T n, L&& f)
noexcept
1261 ParallelFor<MT>(Gpu::KernelInfo{}, n, std::forward<L>(f));
1264template <
typename L,
int dim>
1267 ParallelFor<AMREX_GPU_MAX_THREADS>(
Gpu::KernelInfo{}, box, std::forward<L>(f));
1270template <
int MT,
typename L,
int dim>
1271void ParallelFor (BoxND<dim>
const& box, L&& f)
noexcept
1273 ParallelFor<MT>(Gpu::KernelInfo{}, box, std::forward<L>(f));
1276template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1279 ParallelFor<AMREX_GPU_MAX_THREADS>(
Gpu::KernelInfo{},box,ncomp,std::forward<L>(f));
1282template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1283void ParallelFor (BoxND<dim>
const& box, T ncomp, L&& f)
noexcept
1285 ParallelFor<MT>(Gpu::KernelInfo{},box,ncomp,std::forward<L>(f));
1288template <
typename L1,
typename L2,
int dim>
1289void ParallelFor (BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1291 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1294template <
int MT,
typename L1,
typename L2,
int dim>
1295void ParallelFor (BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1297 ParallelFor<MT>(Gpu::KernelInfo{},box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1300template <
typename L1,
typename L2,
typename L3,
int dim>
1301void ParallelFor (BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1302 L1&& f1, L2&& f2, L3&& f3)
noexcept
1304 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,box2,box3,std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1307template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
1308void ParallelFor (BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1309 L1&& f1, L2&& f2, L3&& f3)
noexcept
1311 ParallelFor<MT>(Gpu::KernelInfo{},box1,box2,box3,std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1314template <
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1315 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1316 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1317void ParallelFor (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1318 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1320 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1323template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1324 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1325 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1326void ParallelFor (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1327 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1329 ParallelFor<MT>(Gpu::KernelInfo{},box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1332template <
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1333 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1334 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1335 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1336void ParallelFor (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1337 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1338 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1340 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},
1341 box1,ncomp1,std::forward<L1>(f1),
1342 box2,ncomp2,std::forward<L2>(f2),
1343 box3,ncomp3,std::forward<L3>(f3));
1346template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1347 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1348 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1349 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1350void ParallelFor (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1351 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1352 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1354 ParallelFor<MT>(Gpu::KernelInfo{},
1355 box1,ncomp1,std::forward<L1>(f1),
1356 box2,ncomp2,std::forward<L2>(f2),
1357 box3,ncomp3,std::forward<L3>(f3));
1360template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1363 ParallelFor<AMREX_GPU_MAX_THREADS>(
Gpu::KernelInfo{}, n,std::forward<L>(f));
1366template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1367void For (T n, L&& f)
noexcept
1369 ParallelFor<MT>(Gpu::KernelInfo{}, n,std::forward<L>(f));
1372template <
typename L,
int dim>
1375 ParallelFor<AMREX_GPU_MAX_THREADS>(
Gpu::KernelInfo{}, box,std::forward<L>(f));
1378template <
int MT,
typename L,
int dim>
1379void For (BoxND<dim>
const& box, L&& f)
noexcept
1381 ParallelFor<MT>(Gpu::KernelInfo{}, box,std::forward<L>(f));
1384template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1387 ParallelFor<AMREX_GPU_MAX_THREADS>(
Gpu::KernelInfo{},box,ncomp,std::forward<L>(f));
1390template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1391void For (BoxND<dim>
const& box, T ncomp, L&& f)
noexcept
1393 ParallelFor<MT>(Gpu::KernelInfo{},box,ncomp,std::forward<L>(f));
1396template <
typename L1,
typename L2,
int dim>
1397void For (BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1399 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1402template <
int MT,
typename L1,
typename L2,
int dim>
1403void For (BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1405 ParallelFor<MT>(Gpu::KernelInfo{},box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1408template <
typename L1,
typename L2,
typename L3,
int dim>
1409void For (BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1410 L1&& f1, L2&& f2, L3&& f3)
noexcept
1412 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,box2,box3,std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1415template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
1416void For (BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1417 L1&& f1, L2&& f2, L3&& f3)
noexcept
1419 ParallelFor<MT>(Gpu::KernelInfo{},box1,box2,box3,std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1422template <
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1423 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1424 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1425void For (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1426 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1428 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1431template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1432 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1433 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1434void For (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1435 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1437 ParallelFor<MT>(Gpu::KernelInfo{},box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1440template <
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1441 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1442 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1443 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1444void For (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1445 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1446 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1448 ParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},
1449 box1,ncomp1,std::forward<L1>(f1),
1450 box2,ncomp2,std::forward<L2>(f2),
1451 box3,ncomp3,std::forward<L3>(f3));
1454template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1455 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1456 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1457 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1458void For (BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1459 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1460 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1462 ParallelFor<MT>(Gpu::KernelInfo{},
1463 box1,ncomp1,std::forward<L1>(f1),
1464 box2,ncomp2,std::forward<L2>(f2),
1465 box3,ncomp3,std::forward<L3>(f3));
1468template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1469std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1473 ParallelFor<AMREX_GPU_MAX_THREADS>(info,n,std::forward<L>(f));
1475#ifdef AMREX_USE_SYCL
1476 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1479 for (T i = 0; i < n; ++i) { f(i); }
1484template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1485std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1489 ParallelFor<MT>(info,n,std::forward<L>(f));
1491#ifdef AMREX_USE_SYCL
1492 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1495 for (T i = 0; i < n; ++i) { f(i); }
1500template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1501std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1504 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(
Gpu::KernelInfo{}, n, std::forward<L>(f));
1507template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1508std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1514template <
typename L,
int dim>
1515std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1519 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box,std::forward<L>(f));
1521#ifdef AMREX_USE_SYCL
1522 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1529template <
int MT,
typename L,
int dim>
1530std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1534 ParallelFor<MT>(info, box,std::forward<L>(f));
1536#ifdef AMREX_USE_SYCL
1537 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1544template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1545std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1549 ParallelFor<AMREX_GPU_MAX_THREADS>(info, box,ncomp,std::forward<L>(f));
1551#ifdef AMREX_USE_SYCL
1552 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1559template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1560std::enable_if_t<MaybeHostDeviceRunnable<L>::value>
1564 ParallelFor<MT>(info, box,ncomp,std::forward<L>(f));
1566#ifdef AMREX_USE_SYCL
1567 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1574template <
typename L1,
typename L2,
int dim>
1575std::enable_if_t<MaybeHostDeviceRunnable<L1>::value && MaybeHostDeviceRunnable<L2>::value>
1580 ParallelFor<AMREX_GPU_MAX_THREADS>(info,box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1582#ifdef AMREX_USE_SYCL
1583 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1591template <
int MT,
typename L1,
typename L2,
int dim>
1592std::enable_if_t<MaybeHostDeviceRunnable<L1>::value && MaybeHostDeviceRunnable<L2>::value>
1597 ParallelFor<MT>(info,box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1599#ifdef AMREX_USE_SYCL
1600 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1608template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
1609std::enable_if_t<MaybeHostDeviceRunnable<L1>::value && MaybeHostDeviceRunnable<L2>::value && MaybeHostDeviceRunnable<L3>::value>
1612 L1&& f1, L2&& f2, L3&& f3)
noexcept
1615 ParallelFor<MT>(info,box1,box2,box3,
1616 std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1618#ifdef AMREX_USE_SYCL
1619 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1628template <
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1629 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1630 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1631std::enable_if_t<MaybeHostDeviceRunnable<L1>::value && MaybeHostDeviceRunnable<L2>::value>
1634 BoxND<dim> const& box2, T2 ncomp2, L2&& f2)
noexcept
1637 ParallelFor<AMREX_GPU_MAX_THREADS>(info,box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1639#ifdef AMREX_USE_SYCL
1640 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1648template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1649 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1650 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1651std::enable_if_t<MaybeHostDeviceRunnable<L1>::value && MaybeHostDeviceRunnable<L2>::value>
1654 BoxND<dim> const& box2, T2 ncomp2, L2&& f2)
noexcept
1657 ParallelFor<MT>(info,box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1659#ifdef AMREX_USE_SYCL
1660 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1668template <
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1669 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1670 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1671 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1672std::enable_if_t<MaybeHostDeviceRunnable<L1>::value && MaybeHostDeviceRunnable<L2>::value && MaybeHostDeviceRunnable<L3>::value>
1676 BoxND<dim> const& box3, T3 ncomp3, L3&& f3)
noexcept
1679 ParallelFor<AMREX_GPU_MAX_THREADS>(info,
1680 box1,ncomp1,std::forward<L1>(f1),
1681 box2,ncomp2,std::forward<L2>(f2),
1682 box3,ncomp3,std::forward<L3>(f3));
1684#ifdef AMREX_USE_SYCL
1685 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1694template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1695 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1696 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1697 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1698std::enable_if_t<MaybeHostDeviceRunnable<L1>::value && MaybeHostDeviceRunnable<L2>::value && MaybeHostDeviceRunnable<L3>::value>
1702 BoxND<dim> const& box3, T3 ncomp3, L3&& f3)
noexcept
1705 ParallelFor<MT>(info,
1706 box1,ncomp1,std::forward<L1>(f1),
1707 box2,ncomp2,std::forward<L2>(f2),
1708 box3,ncomp3,std::forward<L3>(f3));
1710#ifdef AMREX_USE_SYCL
1711 amrex::Abort(
"amrex:: HOST_DEVICE disabled for Intel. It takes too long to compile");
1720template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1721void HostDeviceFor (Gpu::KernelInfo
const& info, T n, L&& f)
noexcept
1723 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(info,n,std::forward<L>(f));
1726template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1727void HostDeviceFor (Gpu::KernelInfo
const& info, T n, L&& f)
noexcept
1729 HostDeviceParallelFor<MT>(info,n,std::forward<L>(f));
1732template <
typename L,
int dim>
1733void HostDeviceFor (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, L&& f)
noexcept
1735 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(info,box,std::forward<L>(f));
1738template <
int MT,
typename L,
int dim>
1739void HostDeviceFor (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, L&& f)
noexcept
1741 HostDeviceParallelFor<MT>(info,box,std::forward<L>(f));
1744template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1745void HostDeviceFor (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, T ncomp, L&& f)
noexcept
1747 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(info,box,ncomp,std::forward<L>(f));
1750template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1751void HostDeviceFor (Gpu::KernelInfo
const& info, BoxND<dim>
const& box, T ncomp, L&& f)
noexcept
1753 HostDeviceParallelFor<MT>(info,box,ncomp,std::forward<L>(f));
1756template <
typename L1,
typename L2,
int dim>
1758 BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1760 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(info,box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1763template <
int MT,
typename L1,
typename L2,
int dim>
1765 BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1767 HostDeviceParallelFor<MT>(info,box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1770template <
typename L1,
typename L2,
typename L3,
int dim>
1772 BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1773 L1&& f1, L2&& f2, L3&& f3)
noexcept
1775 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(info, box1,box2,box3,
1776 std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1779template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
1781 BoxND<dim>
const& box1, BoxND<dim>
const& box2, BoxND<dim>
const& box3,
1782 L1&& f1, L2&& f2, L3&& f3)
noexcept
1784 HostDeviceParallelFor<MT>(info, box1,box2,box3,
1785 std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1788template <
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1789 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1790 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1792 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1793 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1795 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(info,box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1798template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1799 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1800 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1802 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1803 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1805 HostDeviceParallelFor<MT>(info,box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1808template <
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1809 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1810 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1811 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1813 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1814 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1815 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1817 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(info,
1818 box1,ncomp1,std::forward<L1>(f1),
1819 box2,ncomp2,std::forward<L2>(f2),
1820 box3,ncomp3,std::forward<L3>(f3));
1823template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1824 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1825 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1826 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1828 BoxND<dim>
const& box1, T1 ncomp1, L1&& f1,
1829 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1830 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1832 HostDeviceParallelFor<MT>(info,
1833 box1,ncomp1,std::forward<L1>(f1),
1834 box2,ncomp2,std::forward<L2>(f2),
1835 box3,ncomp3,std::forward<L3>(f3));
1838template <
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1841 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},n,std::forward<L>(f));
1844template <
int MT,
typename T,
typename L,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1847 HostDeviceParallelFor<MT>(Gpu::KernelInfo{},n,std::forward<L>(f));
1850template <
typename L,
int dim>
1853 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box,std::forward<L>(f));
1856template <
int MT,
typename L,
int dim>
1859 HostDeviceParallelFor<MT>(Gpu::KernelInfo{},box,std::forward<L>(f));
1862template <
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1865 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box,ncomp,std::forward<L>(f));
1868template <
int MT,
typename T,
typename L,
int dim,
typename M=std::enable_if_t<std::is_
integral_v<T>> >
1871 HostDeviceParallelFor<MT>(Gpu::KernelInfo{},box,ncomp,std::forward<L>(f));
1874template <
typename L1,
typename L2,
int dim>
1875void HostDeviceParallelFor (BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1877 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1880template <
int MT,
typename L1,
typename L2,
int dim>
1881void HostDeviceParallelFor (BoxND<dim>
const& box1, BoxND<dim>
const& box2, L1&& f1, L2&& f2)
noexcept
1883 HostDeviceParallelFor<MT>(Gpu::KernelInfo{},box1,box2,std::forward<L1>(f1),std::forward<L2>(f2));
1886template <
typename L1,
typename L2,
typename L3,
int dim>
1888 L1&& f1, L2&& f2, L3&& f3)
noexcept
1890 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{}, box1,box2,box3,
1891 std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1894template <
int MT,
typename L1,
typename L2,
typename L3,
int dim>
1896 L1&& f1, L2&& f2, L3&& f3)
noexcept
1898 HostDeviceParallelFor<MT>(Gpu::KernelInfo{}, box1,box2,box3,
1899 std::forward<L1>(f1),std::forward<L2>(f2),std::forward<L3>(f3));
1902template <
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1903 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1904 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1906 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1908 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1911template <
int MT,
typename T1,
typename T2,
typename L1,
typename L2,
int dim,
1912 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1913 typename M2=std::enable_if_t<std::is_integral_v<T2>> >
1915 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2)
noexcept
1917 HostDeviceParallelFor<MT>(Gpu::KernelInfo{},box1,ncomp1,std::forward<L1>(f1),box2,ncomp2,std::forward<L2>(f2));
1920template <
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1921 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1922 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1923 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1925 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1926 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1928 HostDeviceParallelFor<AMREX_GPU_MAX_THREADS>(Gpu::KernelInfo{},
1929 box1,ncomp1,std::forward<L1>(f1),
1930 box2,ncomp2,std::forward<L2>(f2),
1931 box3,ncomp3,std::forward<L3>(f3));
1934template <
int MT,
typename T1,
typename T2,
typename T3,
typename L1,
typename L2,
typename L3,
int dim,
1935 typename M1=std::enable_if_t<std::is_integral_v<T1>>,
1936 typename M2=std::enable_if_t<std::is_integral_v<T2>>,
1937 typename M3=std::enable_if_t<std::is_integral_v<T3>> >
1939 BoxND<dim>
const& box2, T2 ncomp2, L2&& f2,
1940 BoxND<dim>
const& box3, T3 ncomp3, L3&& f3)
noexcept
1942 HostDeviceParallelFor<MT>(Gpu::KernelInfo{},
1943 box1,ncomp1,std::forward<L1>(f1),
1944 box2,ncomp2,std::forward<L2>(f2),
1945 box3,ncomp3,std::forward<L3>(f3));
#define AMREX_PRAGMA_SIMD
Definition AMReX_Extension.H:80
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_GPU_ERROR_CHECK()
Definition AMReX_GpuError.H:133
#define AMREX_LAUNCH_KERNEL(MT, blocks, threads, sharedMem, stream,...)
Definition AMReX_GpuLaunch.H:35
#define AMREX_LAUNCH_KERNEL_NOBOUND(blocks, threads, sharedMem, stream,...)
Definition AMReX_GpuLaunch.H:37
#define AMREX_GPU_DEVICE
Definition AMReX_GpuQualifiers.H:18
A Rectangular Domain on an Integer Lattice.
Definition AMReX_Box.H:46
static unsigned int maxBlocksPerLaunch() noexcept
Definition AMReX_GpuDevice.H:197
static constexpr int warp_size
Definition AMReX_GpuDevice.H:194
Definition AMReX_GpuKernelInfo.H:8
Definition AMReX_IntVect.H:55
__host__ __device__ range_detail::range_impl< T > Range(T const &b) noexcept
Definition AMReX_GpuRange.H:125
void streamSynchronize() noexcept
Definition AMReX_GpuDevice.H:260
bool inLaunchRegion() noexcept
Definition AMReX_GpuControl.H:92
gpuStream_t gpuStream() noexcept
Definition AMReX_GpuDevice.H:241
AMREX_FORCE_INLINE auto call_f_intvect_handler(F const &f, IntVectND< dim > iv) noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence< dim >(), f, iv))
Definition AMReX_GpuLaunchFunctsC.H:93
AMREX_FORCE_INLINE auto call_f_intvect_ncomp_handler(F const &f, IntVectND< dim > iv, T n) noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence< dim >(), f, iv, n))
Definition AMReX_GpuLaunchFunctsC.H:121
AMREX_GPU_DEVICE AMREX_FORCE_INLINE auto call_f_intvect_ncomp(F const &f, IntVectND< dim > iv, T ncomp) noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence< dim >(), f, iv, 0))
Definition AMReX_GpuLaunchFunctsG.H:103
AMREX_FORCE_INLINE auto call_f_scalar_handler(F const &f, N i) noexcept -> decltype(f(0))
Definition AMReX_GpuLaunchFunctsC.H:31
AMREX_GPU_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_GpuLaunchFunctsG.H:65
AMREX_FORCE_INLINE auto call_f_intvect_engine(F const &f, IntVectND< dim > iv, RandomEngine engine) noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence< dim >(), f, iv, engine))
Definition AMReX_GpuLaunchFunctsC.H:83
AMREX_FORCE_INLINE auto call_f_intvect_ncomp_engine(F const &f, IntVectND< dim > iv, T n, RandomEngine engine) noexcept -> decltype(call_f_intvect_inner(std::make_index_sequence< dim >(), f, iv, n, engine))
Definition AMReX_GpuLaunchFunctsC.H:111
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_GpuLaunchFunctsC.H:49
Definition AMReX_Amr.cpp:49
std::enable_if_t< std::is_integral_v< T > > ParallelFor(TypeList< CTOs... > ctos, std::array< int, sizeof...(CTOs)> const &runtime_options, T N, F &&f)
Definition AMReX_CTOParallelForImpl.H:191
__host__ __device__ constexpr GpuTupleElement< I, GpuTuple< Ts... > >::type & get(GpuTuple< Ts... > &tup) noexcept
Definition AMReX_Tuple.H:179
cudaStream_t gpuStream_t
Definition AMReX_GpuControl.H:83
randState_t * getRandState()
Definition AMReX_RandomEngine.H:65
__host__ __device__ constexpr const T & min(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:21
void launch(T const &n, L &&f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:138
void HostDeviceFor(T n, L &&f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:912
void HostDeviceParallelFor(T n, L &&f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:799
bool isEmpty(T n) noexcept
Definition AMReX_GpuRange.H:14
__host__ __device__ constexpr const T & max(const T &a, const T &b) noexcept
Definition AMReX_Algorithm.H:35
void single_task(L &&f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:1350
curandState_t randState_t
Definition AMReX_RandomEngine.H:58
void LoopConcurrentOnCpu(Dim3 lo, Dim3 hi, F const &f) noexcept
Definition AMReX_Loop.H:378
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:230
AMREX_ATTRIBUTE_FLATTEN_FOR void For(T n, L const &f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:152
AMREX_ATTRIBUTE_FLATTEN_FOR void ParallelForRNG(T n, L const &f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:1264
Definition AMReX_FabArrayCommI.H:1000
Definition AMReX_Box.H:2045
__host__ __device__ IntVectND< dim > intVect(std::uint64_t icell) const
Definition AMReX_Box.H:2062
__host__ __device__ std::uint64_t numPts() const
Definition AMReX_Box.H:2086
Definition AMReX_GpuLaunch.H:132
Definition AMReX_GpuTypes.H:86
Definition AMReX_RandomEngine.H:72