Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
amrex::simd Namespace Reference

Namespaces

namespace  detail
 
namespace  stdx
 

Classes

struct  Vectorized
 

Typedefs

template<int SIMD_WIDTH = native_simd_size_real>
using SIMDReal = amrex::Real
 
template<int SIMD_WIDTH = native_simd_size_particlereal>
using SIMDParticleReal = amrex::ParticleReal
 
template<typename T_ParticleReal = SIMDParticleReal<>>
using SIMDIdCpu = std::uint64_t
 

Functions

template<typename R , typename... Args>
constexpr bool is_nth_arg_non_const (R(*)(Args...), int n)
 
template<typename C , typename R , typename... Args>
constexpr bool is_nth_arg_non_const (R(C::*)(Args...), int n)
 

Variables

constexpr auto native_simd_size_real = 1
 
constexpr auto native_simd_size_particlereal = 1
 
template<typename T >
constexpr bool is_vectorized = std::is_base_of_v<detail::InternalVectorized, T>
 

Typedef Documentation

◆ SIMDIdCpu

template<typename T_ParticleReal = SIMDParticleReal<>>
using amrex::simd::SIMDIdCpu = typedef std::uint64_t

◆ SIMDParticleReal

template<int SIMD_WIDTH = native_simd_size_particlereal>
using amrex::simd::SIMDParticleReal = typedef amrex::ParticleReal

◆ SIMDReal

template<int SIMD_WIDTH = native_simd_size_real>
using amrex::simd::SIMDReal = typedef amrex::Real

Function Documentation

◆ is_nth_arg_non_const() [1/2]

template<typename R , typename... Args>
constexpr bool amrex::simd::is_nth_arg_non_const ( R(*)(Args...)  ,
int  n 
)
constexpr

Check if a function argument is declared as non-const

Use in conjunction with conditional write-back logic from vector registers, e.g.,

template<typename T_Real>
void compute (T_Real & AMREX_RESTRICT x,
T_Real const & AMREX_RESTRICT y) { ... }
part_x.copy_from(&m_part_x[i], stdx::element_aligned);
part_y.copy_from(&m_part_y[i], stdx::element_aligned);
compute(part_x, part_y);
if constexpr (is_nth_arg_non_const(compute<double>, 0))
part_x.copy_to(&m_part_x[i], stdx::element_aligned);
if constexpr (is_nth_arg_non_const(compute<double>, 1))
part_y.copy_to(&m_part_y[i], stdx::element_aligned);
#define AMREX_RESTRICT
Definition AMReX_Extension.H:37
constexpr bool is_nth_arg_non_const(R(*)(Args...), int n)
Definition AMReX_SIMD.H:138

◆ is_nth_arg_non_const() [2/2]

template<typename C , typename R , typename... Args>
constexpr bool amrex::simd::is_nth_arg_non_const ( R(C::*)(Args...)  ,
int  n 
)
constexpr

Variable Documentation

◆ is_vectorized

template<typename T >
constexpr bool amrex::simd::is_vectorized = std::is_base_of_v<detail::InternalVectorized, T>
constexpr

Check if a Functor Class works with amrex::ParallelForSIMD

See also
amrex::simd::Vectorized

◆ native_simd_size_particlereal

constexpr auto amrex::simd::native_simd_size_particlereal = 1
constexpr

◆ native_simd_size_real

constexpr auto amrex::simd::native_simd_size_real = 1
constexpr