34 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
36 template <
typename F, Array... As>
38 template <
char OP, Array A>
63 using AddressSpace::Device;
66 using AddressSpace::Host;
69 using AddressSpace::None;
72 using AddressSpace::Unified;
105 static_assert(!(A1 == Host && A2 == Device) && !(A1 == Device && A2 == Host),
106 "Error in nda::mem::combine: Cannot combine Host and Device address spaces");
107 if constexpr (
sizeof...(As) > 0) {
return combine<std::max(A1, A2), As...>; }
108 return std::max(A1, A2);
123 template <MemoryArray A>
131 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
135 template <
typename F,
Array... As>
139 template <
char OP, Array A>
152 static_assert(((AdrSpcs != None) & ...),
"Error in nda::mem::check_adr_sp_valid: Cannot use None address space");
154 "Error in nda::mem::check_adr_sp_valid: Device address space requires compiling with GPU support.");
158 template <
typename... Ts>
159 requires(
sizeof...(Ts) > 0)
163 template <
typename... Ts>
164 requires(
sizeof...(Ts) > 0)
168 template <
typename... Ts>
169 requires(
sizeof...(Ts) > 0)
173 template <
typename A0,
typename... A>
177 template <
typename... Ts>
181 template <
typename... Ts>
185 template <
typename... Ts>
Check if a given type satisfies the array concept.
Check if a given type satisfies the memory array concept.
Provides concepts for the nda library.
Provides GPU and non-GPU specific functionality.
AddressSpace
Enum providing identifiers for the different memory address spaces.
static constexpr AddressSpace get_addr_space< H >
Specialization of nda::mem::get_addr_space for nda::Handle types.
static constexpr bool have_host_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Host.
static constexpr bool have_compatible_addr_space
Constexpr variable that is true if all given types have compatible address spaces.
constexpr AddressSpace combine
Promotion rules for nda::mem::AddressSpace values.
static constexpr bool have_device_compatible_addr_space
Constexpr variable that is true if all given types have an address space compatible with Device.
static constexpr bool on_device
Constexpr variable that is true if all given types have a Device address space.
static constexpr bool on_unified
Constexpr variable that is true if all given types have a Unified address space.
static constexpr AddressSpace get_addr_space
Variable template providing the address space for different types.
static constexpr AddressSpace get_addr_space< A >
Specialization of nda::mem::get_addr_space for nda::Memory Array types.
static constexpr bool on_host
Constexpr variable that is true if all given types have a Host address space.
constexpr AddressSpace common_addr_space
Get common address space for a number of given nda::MemoryArray types.
static const auto check_adr_sp_valid
Check validity of a set of nda::mem::AddressSpace values.
static constexpr bool have_same_addr_space
Constexpr variable that is true if all given types have the same address space.
static constexpr bool have_device
Constexpr variable that is true if the project is configured with GPU support.
A lazy function call expression on arrays/views.