1#ifndef AMREX_GPU_RANGE_H_
2#define AMREX_GPU_RANGE_H_
3#include <AMReX_Config.H>
13template <
typename T, std::enable_if_t<std::is_
integral_v<T>,
int> = 0>
14bool isEmpty (T n)
noexcept {
return n <= 0; }
21namespace range_detail {
24template <
typename T, std::enable_if_t<std::is_
integral_v<T>,
int> = 0>
26Long
size (T
const&
b)
noexcept {
return static_cast<Long
>(
b); }
28template <
typename T, std::enable_if_t<std::is_
integral_v<T>,
int> = 0>
65 range_impl (T
const&
b, Long gid, Long grange) noexcept
91#if defined (__SYCL_DEVICE_ONLY__)
95 return iterator(
m_b, blockDim.x*blockIdx.x+threadIdx.x, blockDim.x*gridDim.x);
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_IF_ON_DEVICE(CODE)
Definition AMReX_GpuQualifiers.H:56
#define AMREX_IF_ON_HOST(CODE)
Definition AMReX_GpuQualifiers.H:58
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
Array4< int const > offset
Definition AMReX_HypreMLABecLap.cpp:1089
A Rectangular Domain on an Integer Lattice.
Definition AMReX_Box.H:43
AMREX_GPU_HOST_DEVICE Long at(T const &, Long offset) noexcept
Definition AMReX_GpuRange.H:30
AMREX_GPU_HOST_DEVICE Long size(T const &b) noexcept
integer version
Definition AMReX_GpuRange.H:26
AMREX_GPU_HOST_DEVICE range_detail::range_impl< T > Range(T const &b) noexcept
Definition AMReX_GpuRange.H:125
Definition AMReX_Amr.cpp:49
bool isEmpty(T n) noexcept
Definition AMReX_GpuRange.H:14
AMREX_GPU_HOST_DEVICE AMREX_FORCE_INLINE void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition AMReX.H:127
Definition AMReX_GpuRange.H:70
AMREX_GPU_HOST_DEVICE void operator++() noexcept
Definition AMReX_GpuRange.H:75
AMREX_GPU_HOST_DEVICE T operator*() const noexcept
Definition AMReX_GpuRange.H:81
Long mi_i
Definition AMReX_GpuRange.H:85
T const * mi_b
Definition AMReX_GpuRange.H:84
AMREX_GPU_HOST_DEVICE iterator(T const &b, Long i, Long s) noexcept
Definition AMReX_GpuRange.H:72
AMREX_GPU_HOST_DEVICE bool operator!=(iterator const &rhs) const noexcept
Definition AMReX_GpuRange.H:78
Long mi_s
Definition AMReX_GpuRange.H:86
Definition AMReX_GpuRange.H:60
T m_b
Definition AMReX_GpuRange.H:107
AMREX_GPU_HOST_DEVICE iterator end() const noexcept
Definition AMReX_GpuRange.H:104
AMREX_GPU_HOST_DEVICE iterator begin() const noexcept
Definition AMReX_GpuRange.H:90
Long m_n
Definition AMReX_GpuRange.H:108
AMREX_GPU_HOST_DEVICE range_impl(T const &b) noexcept
Definition AMReX_GpuRange.H:62