14 #include <type_traits>
23 template<std::
size_t TStaticAllocKiB>
27 static constexpr std::uint32_t
staticAllocBytes =
static_cast<std::uint32_t
>(TStaticAllocKiB << 10u);
31 #if BOOST_COMP_MSVC || defined(BOOST_COMP_MSVC_EMULATED)
32 # pragma warning(push)
33 # pragma warning(disable : 4324)
38 template<std::
size_t TStaticAllocKiB = BlockSharedDynMemberAllocKiB>
50 return std::data(m_mem);
57 return std::data(m_mem) + m_dynPitch;
77 static auto getPitch(std::size_t sizeBytes) -> std::uint32_t
80 return static_cast<std::uint32_t
>((sizeBytes / alignment + (sizeBytes % alignment > 0u)) * alignment);
83 mutable std::array<uint8_t, detail::BlockSharedMemDynMemberStatic<TStaticAllocKiB>::staticAllocBytes> m_mem;
84 std::uint32_t m_dynPitch;
86 #if BOOST_COMP_MSVC || defined(BOOST_COMP_MSVC_EMULATED)
92 template<
typename T, std::
size_t TStaticAllocKiB>
96 # pragma GCC diagnostic push
97 # pragma GCC diagnostic ignored \
104 "Unable to get block shared dynamic memory for types with alignment higher than "
105 "defaultAlignment!");
106 return reinterpret_cast<T*
>(mem.dynMemBegin());
109 # pragma GCC diagnostic pop
#define ALPAKA_ASSERT_ACC(...)
ALPAKA_ASSERT_ACC is an assert-like macro.
Dynamic block shared memory provider using fixed-size member array to allocate memory on the stack or...
static constexpr auto staticAllocBytes() -> std::uint32_t
auto dynMemBegin() const -> uint8_t *
auto staticMemBegin() const -> uint8_t *
BlockSharedMemDynMember(std::size_t sizeBytes)
auto staticMemCapacity() const -> std::uint32_t
constexpr std::size_t defaultAlignment
The alpaka accelerator library.
"namespace" for static constexpr members that should be in BlockSharedMemDynMember but cannot be beca...
static constexpr std::uint32_t staticAllocBytes
Storage size in bytes.
Tag used in class inheritance hierarchies that describes that a specific interface (TInterface) is im...
static auto getMem(BlockSharedMemDynMember< TStaticAllocKiB > const &mem) -> T *
The block shared dynamic memory get trait.