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 >:
amrex::simd::detail::InternalVectorized

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:37
#define AMREX_GPU_HOST_DEVICE
Definition AMReX_GpuQualifiers.H:20
AMREX_ATTRIBUTE_FLATTEN_FOR void ParallelForSIMD(N n, L const &f) noexcept
Definition AMReX_GpuLaunchFunctsC.H:206
Definition AMReX_SIMD.H:105

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: