11#include "vecmem/utils/types.hpp"
46template <
typename SIZE_TYPE,
typename INPUT_TYPE>
50 std::is_integral_v<SIZE_TYPE> && std::is_unsigned_v<SIZE_TYPE>,
51 "The device-side size type must be an unsigned integer type");
53 std::is_integral_v<INPUT_TYPE> && std::is_unsigned_v<INPUT_TYPE>,
54 "Only unsigned sizes can be narrowed with this helper");
56 assert(
static_cast<std::size_t
>(size) <=
57 static_cast<std::size_t
>(std::numeric_limits<SIZE_TYPE>::max()));
An allocator class that wraps a memory resource.
Definition allocator.hpp:37
Namespace for types that should not be used directly by clients.
Definition array.hpp:23
VECMEM_HOST constexpr SIZE_TYPE narrow_size(INPUT_TYPE size)
Narrow a host-side element count to a device-side size type.
Definition narrow_size.hpp:47