|
template<typename T>
requires requires(std::size_t n) { { R::template allocate_device<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_device<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_device<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 R = runtime::preferred>
struct mtl::memory_space::device< R >
Device memory of runtime R, which host code cannot touch.
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.