4#include <AMReX_Config.H>
12# if __cplusplus >= 202002L
13# include <vir/simd_cvt.h>
27 using namespace vir::stdx;
28# if __cplusplus >= 202002L
35 bool any_of (
bool const v) {
return v; }
49 template<
int SIMD_WIDTH = native_simd_size_real>
50 using SIMDReal = stdx::fixed_size_simd<amrex::Real, SIMD_WIDTH>;
52 template<
int SIMD_WIDTH = native_simd_size_particlereal>
53 using SIMDParticleReal = stdx::fixed_size_simd<amrex::ParticleReal, SIMD_WIDTH>;
56 template<
typename T_ParticleReal = SIMDParticleReal<>>
57 using SIMDInt = stdx::rebind_simd_t<int, T_ParticleReal>;
60 template<
typename T_ParticleReal = SIMDParticleReal<>>
61 using SIMDIdCpu = stdx::rebind_simd_t<std::uint64_t, T_ParticleReal>;
66 template<
int SIMD_WIDTH = native_simd_size_real>
69 template<
int SIMD_WIDTH = native_simd_size_particlereal>
73 template<
typename T_ParticleReal = SIMDParticleReal<>>
77 template<
typename T_ParticleReal = SIMDParticleReal<>>
83 struct InternalVectorized {};
113 template<
int SIMD_WIDTH = native_simd_size_real>
118 static constexpr int simd_width = SIMD_WIDTH;
126 constexpr bool is_vectorized = std::is_base_of_v<detail::InternalVectorized, T>;
148 template<
typename R,
typename... Args>
151 constexpr bool val_arr[
sizeof...(Args)] {!std::is_const_v<std::remove_reference_t<Args>>...};
155 template<
typename C,
typename R,
typename... Args>
158 constexpr bool val_arr[
sizeof...(Args)] {!std::is_const_v<std::remove_reference_t<Args>>...};
161 template<
typename C,
typename R,
typename... Args>
164 constexpr bool val_arr[
sizeof...(Args)] {!std::is_const_v<std::remove_reference_t<Args>>...};
181 template <
typename T,
typename IndexType>
185 if constexpr (std::is_integral_v<IndexType>) {
187 }
else if constexpr (IndexType::width == 1) {
191 using DataType = stdx::fixed_size_simd<std::decay_t<T>, IndexType::width>;
198 val.copy_from(&ptr[i.index], stdx::element_aligned);
202 static_assert(IndexType::width == 1,
"SIMD width must be 1 for non-SIMD builds");
230 template <auto P_Method,
int N,
typename T,
typename IndexType,
typename ValType>
239 if constexpr (!std::is_same_v<ValType, T>) {
246 val.copy_to(&ptr[i.index], amrex::simd::stdx::element_aligned);
248 amrex::Abort(
"store_1d: ValType val must alias T ptr data (to make this a no-OP).");
#define AMREX_FORCE_INLINE
Definition AMReX_Extension.H:119
#define AMREX_RESTRICT
Definition AMReX_Extension.H:32
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
amrex_real Real
Floating Point Type for Fields.
Definition AMReX_REAL.H:79
amrex_particle_real ParticleReal
Floating Point Type for Particles.
Definition AMReX_REAL.H:90
__host__ __device__ bool any_of(bool const v)
Definition AMReX_SIMD.H:35
Definition AMReX_SIMD.H:22
std::uint64_t SIMDIdCpu
Definition AMReX_SIMD.H:78
__host__ __device__ void store_1d(ValType const &__restrict__ val, T *const __restrict__ ptr, IndexType const i)
Definition AMReX_SIMD.H:232
constexpr auto native_simd_size_real
Definition AMReX_SIMD.H:63
int SIMDInt
Definition AMReX_SIMD.H:74
constexpr bool is_vectorized
Definition AMReX_SIMD.H:126
constexpr bool is_nth_arg_non_const(R(*)(Args...), int n)
Definition AMReX_SIMD.H:149
amrex::ParticleReal SIMDParticleReal
Definition AMReX_SIMD.H:70
__host__ __device__ decltype(auto) load_1d(T *ptr, IndexType const i)
Definition AMReX_SIMD.H:183
constexpr auto native_simd_size_particlereal
Definition AMReX_SIMD.H:64
amrex::Real SIMDReal
Definition AMReX_SIMD.H:67
__host__ __device__ void ignore_unused(const Ts &...)
This shuts up the compiler about unused variables.
Definition AMReX.H:139
void Abort(const std::string &msg)
Print out message to cerr and exit via abort().
Definition AMReX.cpp:230
const int[]
Definition AMReX_BLProfiler.cpp:1664
Definition AMReX_SIMD.H:116