Memory the host and R's devices can both address (CUDA or HIP managed memory, SYCL USM shared, Metal shared storage, an integrated GPU's memory).
More...
|
template<typename T>
requires requires(std::size_t n) { { R::template allocate_shared<T>(n) } -> std::same_as<handle_type<T>>; } |
| static handle_type< T > | allocate (std::size_t n) |
template<typename T>
requires std::is_same_v<handle_type<T>, T*> && requires(T* p, std::size_t n) { R::template deallocate_shared<T>(p, n); } |
| static void | deallocate (T *p, std::size_t n) noexcept |
template<typename T>
requires (!std::is_same_v<handle_type<T>, T*>) && requires(handle_type<T> h, std::size_t n) { R::template deallocate_shared<T>(h, n); } |
| static void | deallocate (handle_type< T > h, std::size_t n) noexcept |
template<typename H>
requires requires(H h, std::size_t i) { { R::offset(h, i) } -> std::same_as<H>; } |
| static H | offset (H h, std::size_t i) |
| | The handle of element i, for a handle that is not an element pointer (handle_traits steps a T* itself).
|
template<typename H>
requires requires(H h) { { R::address(h) } -> std::convertible_to<const volatile void*>; } |
| static auto | address (H h) |
| | The host address of a handle's first element, for a handle that is not an element pointer: shared memory is host-accessible.
|
template<typename R = runtime::preferred>
struct mtl::memory_space::shared< R >
Memory the host and R's devices can both address (CUDA or HIP managed memory, SYCL USM shared, Metal shared storage, an integrated GPU's memory).
Both may address it, but not at the same instant: the host touches it only while no device work writing it is in flight.
template<typename R = runtime::preferred>
template<typename H>
requires requires(H h, std::size_t i) { { R::offset(h, i) } -> std::same_as<H>; }
The handle of element i, for a handle that is not an element pointer (handle_traits steps a T* itself).
A pointer to an opaque token is such a handle, so the constraint is only that R provides offset.