7 #include "../ProxyRefOpMixin.hpp"
19 if constexpr(
sizeof(T) == 1)
26 for(std::size_t i = 0; i <
sizeof(T) / 2; i++)
28 const auto a = arr[i];
29 const auto b = arr[
sizeof(T) - 1 - i];
31 arr[
sizeof(T) - 1 - i] = a;
56 template<
typename RecordDim>
58 = mp_transform<MakeByteswapProjectionPair, mp_unique<FlatRecordDim<RecordDim>>>;
63 template<
typename ArrayExtents,
typename RecordDim,
template<
typename,
typename>
typename InnerMapping>
64 struct Byteswap :
Projection<ArrayExtents, RecordDim, InnerMapping, internal::MakeByteswapProjectionMap<RecordDim>>
76 template<
template<
typename,
typename>
typename InnerMapping>
79 template<
typename ArrayExtents,
typename RecordDim>
84 template<
typename Mapping>
88 template<
typename TArrayExtents,
typename TRecordDim,
template<
typename,
typename>
typename InnerMapping>
89 inline constexpr
bool isByteswap<Byteswap<TArrayExtents, TRecordDim, InnerMapping>> =
true;
#define LLAMA_FN_HOST_ACC_INLINE
mp_list< T, ByteswapProjection< T > > MakeByteswapProjectionPair
mp_transform< MakeByteswapProjectionPair, mp_unique< FlatRecordDim< RecordDim > >> MakeByteswapProjectionMap
constexpr bool isByteswap
Mapping that swaps the byte order of all values when loading/storing.
static auto store(T v) -> T
static auto load(T v) -> T