![]() |
Block-Structured AMR Software Framework
|
Namespaces | |
| 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 | SIMDInt = int |
| 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) |
| template<typename T , typename IndexType > | |
| __host__ __device__ decltype(auto) | load_1d (T *ptr, IndexType const i) |
| template<auto P_Method, int N, typename T , typename IndexType , typename ValType > | |
| __host__ __device__ void | store_1d (ValType const &__restrict__ val, T *const __restrict__ ptr, IndexType const i) |
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> |
| using amrex::simd::SIMDIdCpu = typedef std::uint64_t |
| using amrex::simd::SIMDInt = typedef int |
| using amrex::simd::SIMDParticleReal = typedef amrex::ParticleReal |
| using amrex::simd::SIMDReal = typedef amrex::Real |
|
constexpr |
Check if a function argument is declared as non-const
Use in conjunction with conditional write-back logic from vector registers, e.g.,
|
constexpr |
|
inline |
Load 1D contiguous data from array pointers
On GPU and CPU w/o SIMD, this dereferences a 1D array element at the index position i. On CPU with SIMD, this loads a SIMD register at the IndexType::width SIMD-wide index position i.
| T | data type (amrex::ParticleReal or int or uint64_t) |
| IndexType | int or amrex::SIMDindex<SIMD_WIDTH, int> |
| ptr | pointer to the array data |
| i | index or SIMD index |
|
inline |
Store SIMD register data back to a 1D contiguous array in RAM
On GPU and CPU without SIMD, this does nothing because we already modified the (global) RAM directly via pointer.
On CPU with SIMD, this performs a conditional writeback of a SIMD register to RAM (index in pointer array), but only if the argument was not passed as const and thus was likely changed.
Good optimizing compilers can eliminate writebacks of unchanged values themselves, but we better help a little for robustness. Background: https://github.com/AMReX-Codes/amrex/pull/4520#issuecomment-3064064215
| P_Method | pointer to the method that used the data (for is_nth_arg_non_const) |
| N | the argument index (for is_nth_arg_non_const) |
| T | data type |
| IndexType | int or SIMD index |
| ValType | the type of the value to store |
| val | the value to store |
| ptr | pointer to contiguous 1D array data |
| i | index or SIMD index |
|
constexpr |
Check if a Functor Class works with amrex::ParallelForSIMD
|
constexpr |
|
constexpr |