Block-Structured AMR Software Framework
 
Loading...
Searching...
No Matches
amrex::simd::Vectorized< SIMD_WIDTH > Struct Template Reference

#include <AMReX_SIMD.H>

Inheritance diagram for amrex::simd::Vectorized< SIMD_WIDTH >:

Static Public Attributes

static constexpr int simd_width = SIMD_WIDTH
 SIMD width in elements.
 

Detailed Description

template<int SIMD_WIDTH = native_simd_size_real>
struct amrex::simd::Vectorized< SIMD_WIDTH >

Mixin Helper Class

Use this class as a mixin (base) class to simplify writing functors that support/do not support ParallelForSIMD.

Example:

struct Compute : public Vectorized<>
{
template<typename T_Real>
void operator() (T_Real & AMREX_RESTRICT x) { ... }
};
// ... call site below
{
Compute c;
if constexpr (amrex::simd::is_vectorized<Compute>) {
ParallelForSIMD<...>(np, c).
} else {
ParallelFor(np, c);
}
}
#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
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:193
AMREX_ATTRIBUTE_FLATTEN_FOR void ParallelForSIMD(N n, L const &f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:208
Definition AMReX_SIMD.H:107

Member Data Documentation

◆ simd_width

template<int SIMD_WIDTH = native_simd_size_real>
constexpr int amrex::simd::Vectorized< SIMD_WIDTH >::simd_width = SIMD_WIDTH
staticconstexpr

SIMD width in elements.


The documentation for this struct was generated from the following file: