16 template<
typename RecordDim, std::
size_t VectorRegisterBits>
17 inline constexpr std::size_t
maxLanes = []() constexpr
19 auto max = std::numeric_limits<std::size_t>::max();
20 forEachLeafCoord<RecordDim>(
23 using AttributeType =
GetType<RecordDim, decltype(rc)>;
24 max = std::min(max, VectorRegisterBits / (
sizeof(AttributeType) * CHAR_BIT));
38 typename TArrayExtents,
40 typename TArrayExtents::value_type Lanes,
42 typename TLinearizeArrayIndexFunctor = LinearizeArrayIndexRight,
43 template<
typename>
typename PermuteFields = PermuteFieldsInOrder>
51 inline static constexpr
typename TArrayExtents::value_type
lanes = Lanes;
54 using Permuter = PermuteFields<FlatRecordDim<TRecordDim>>;
57 #if defined(__NVCC__) && __CUDACC_VER_MAJOR__ >= 12
69 const auto rs =
static_cast<size_type
>(
70 flatSizeOf<typename Permuter::FlatRecordDim, fieldAlignment == FieldAlignment::Align>);
74 template<std::size_t... RecordCoords>
83 template<std::size_t... RecordCoords>
85 size_type flatArrayIndex,
88 constexpr std::size_t flatFieldIndex =
89 #if defined(__NVCC__) && __CUDACC_VER_MAJOR__ == 11 && __CUDACC_VER_MINOR__ <= 6
93 const auto blockIndex = flatArrayIndex / Lanes;
94 const auto laneIndex = flatArrayIndex % Lanes;
96 =
static_cast<size_type
>(
97 flatSizeOf<typename Permuter::FlatRecordDim, fieldAlignment == FieldAlignment::Align> * Lanes)
104 +
static_cast<size_type
>(
sizeof(
GetType<TRecordDim,
RecordCoord<RecordCoords...>>)) * laneIndex;
115 typename LinearizeArrayIndexFunctor = LinearizeArrayIndexRight,
116 template<
typename>
typename PermuteFields = PermuteFieldsInOrder>
119 template<
typename ArrayExtents,
typename RecordDim>
124 template<
typename Mapping>
131 typename AD::value_type L,
136 inline constexpr
bool isAoSoA<AoSoA<AD, RD, L, A, Lin, Perm>> =
true;
#define LLAMA_FN_HOST_ACC_INLINE
constexpr std::size_t maxLanes
typename internal::FlattenRecordDimImpl< RecordDim >::type FlatRecordDim
Returns a flat type list containing all leaf field types of the given record dimension.
constexpr std::size_t flatRecordCoord
constexpr std::size_t flatOffsetOf
The byte offset of an element in a type list ifs elements would be in a normal struct.
constexpr auto roundUpToMultiple(Integral n, Integral mult) -> Integral
Returns the integral n rounded up to be a multiple of mult.
typename internal::GetTypeImpl< RecordDim, RecordCoordOrTags... >::type GetType
PermuteFields< FlatRecordDim< TRecordDim > > Permuter
constexpr auto blobSize(size_type) const -> size_type
static constexpr TArrayExtents::value_type lanes
constexpr auto blobNrAndOffset(size_type flatArrayIndex, RecordCoord< RecordCoords... >={}) const -> NrAndOffset< size_type >
constexpr AoSoA(TArrayExtents extents, TRecordDim={})
static constexpr FieldAlignment fieldAlignment
TLinearizeArrayIndexFunctor LinearizeArrayIndexFunctor
constexpr AoSoA()=default
static constexpr std::size_t blobCount
constexpr auto blobNrAndOffset(typename Base::ArrayIndex ai, RecordCoord< RecordCoords... > rc={}) const -> NrAndOffset< size_type >
typename ArrayExtents::value_type size_type
typename ArrayExtents::Index ArrayIndex
constexpr auto extents() const -> ArrayExtents