1 #ifndef HeterogeneousCore_CUDAUtilities_interface_eigenSoA_h 2 #define HeterogeneousCore_CUDAUtilities_interface_eigenSoA_h 16 template <
typename T,
int S>
31 static_assert(
isPowerOf2(
S),
"SoA stride not a power of 2");
32 static_assert(
sizeof(
data_) % 128 == 0,
"SoA size not a multiple of 128");
35 template <
typename M,
int S>
39 using Map = Eigen::Map<M, 0, Eigen::Stride<M::RowsAtCompileTime * S, S> >;
40 using CMap = Eigen::Map<const M, 0, Eigen::Stride<M::RowsAtCompileTime * S, S> >;
49 static_assert(
isPowerOf2(
S),
"SoA stride not a power of 2");
50 static_assert(
sizeof(
data_) % 128 == 0,
"SoA size not a multiple of 128");
55 #endif // HeterogeneousCore_CUDAUtilities_interface_eigenSoA_h
constexpr bool isPowerOf2(int32_t v)
Eigen::Map< const M, 0, Eigen::Stride< M::RowsAtCompileTime *S, S > > CMap
__device__ constexpr const Scalar operator()(int32_t i) const
__host__ __device__ constexpr Map operator[](int32_t i)
__host__ __device__ constexpr Map operator()(int32_t i)
__host__ __device__ constexpr Scalar & operator[](int32_t i)
__device__ constexpr const Scalar operator[](int32_t i) const
Scalar data_[S *M::RowsAtCompileTime *M::ColsAtCompileTime]
__host__ __device__ constexpr Scalar & operator()(int32_t i)
typename M::Scalar Scalar
__host__ __device__ constexpr CMap operator[](int32_t i) const
__host__ __device__ constexpr Scalar * data()
__host__ __device__ constexpr CMap operator()(int32_t i) const
__host__ __device__ constexpr Scalar const * data() const
Eigen::Map< M, 0, Eigen::Stride< M::RowsAtCompileTime *S, S > > Map