23 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
25 template <
typename F,
Array... As>
27 template <
char OP, Array A>
52 using AddressSpace::Device;
55 using AddressSpace::Host;
58 using AddressSpace::None;
61 using AddressSpace::Unified;
94 static_assert(!(A1 == Host && A2 == Device) && !(A1 == Device && A2 == Host),
95 "Error in nda::mem::combine: Cannot combine Host and Device address spaces");
96 if constexpr (
sizeof...(As) > 0) {
return combine<std::max(A1, A2), As...>; }
97 return std::max(A1, A2);
112 template <MemoryArray A>
120 template <
char OP, ArrayOrScalar L, ArrayOrScalar R>
124 template <
typename F,
Array... As>
128 template <
char OP, Array A>
141 static_assert(((AdrSpcs != None) & ...),
"Error in nda::mem::check_adr_sp_valid: Cannot use None address space");
143 "Error in nda::mem::check_adr_sp_valid: Device address space requires compiling with GPU support.");
147 template <
typename... Ts>
148 requires(
sizeof...(Ts) > 0)
152 template <
typename... Ts>
153 requires(
sizeof...(Ts) > 0)
157 template <
typename... Ts>
158 requires(
sizeof...(Ts) > 0)
162 template <
typename A0,
typename... A>
166 template <
typename... Ts>
170 template <
typename... Ts>
174 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 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 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.
Lazy unary expression for nda::Array types.
Lazy binary expression for nda::ArrayOrScalar types.