MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
memory_space.hpp File Reference
#include <concepts>
#include <cstddef>
#include <type_traits>
#include <mtl/detail/aligned_allocator.hpp>
#include <mtl/memory/runtime.hpp>

Classes

struct  mtl::detail::runtime_device_handle< R, T >
 The handle a runtime names memory of one kind by: its device_handle<T>, shared_handle<T> (DeviceRuntime, optional), or T* when it declares none. More...
struct  mtl::detail::runtime_device_handle< R, T >
struct  mtl::detail::runtime_shared_handle< R, T >
struct  mtl::detail::runtime_shared_handle< R, T >
struct  mtl::memory_space::host
 Host memory: MTL5's default, over-aligned operator new and delete. More...
struct  mtl::memory_space::device< R >
 Device memory of runtime R, which host code cannot touch. More...
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). More...
struct  mtl::memory_space::pinned< R >
 Host memory page-locked by R, so transfers to and from R's devices can be DMA'd. More...
struct  mtl::detail::space_handle< S, T >
 The handle space S names T storage by: S::handle_type<T>, or T* for a space that declares none (#1017). More...
struct  mtl::detail::space_handle< S, T >
struct  mtl::detail::handle_traits< S, T >
 How space S names T storage, with one interface for pointers and for the handles that are not (#1017, following std::mdspan's accessor policy): handle_type S::handle_type<T>, or T* const_handle_type const T* for a pointer; the handle itself otherwise (as for mdspan, constness is the accessor's business) is_pointer whether handle_type is T* offset(h, i) the handle of element i: h + i, or S::offset(h, i) address(h) the host address of the first element, in a host-accessible space: h, or S::address(h) same(a, b) whether two handles name the same storage, where that can be told: equal pointers, or equal handles of a type with ==; false for a handle without == is_null(h) whether h names no storage (nullptr, or a value-initialized handle of a type with ==). More...
struct  mtl::detail::memory_space_of< T >
 The memory space a type names (T::memory_space), or memory_space::host for a type that names none: a parameter bundle written before #223, an expression, a view or a user type, all of which address host memory. More...
struct  mtl::detail::memory_space_of< T >
struct  mtl::detail::runtime_of_space< S >
 The runtime a memory space belongs to: S::runtime for a device memory kind, runtime::none for host memory and for a space that names no runtime. More...
struct  mtl::detail::runtime_of_space< S >

Namespaces

namespace  mtl
namespace  mtl::detail
 mat*vec multiply into pre-allocated y: y = A * x.
namespace  mtl::memory_space

Concepts

concept  mtl::MemorySpace
 A memory space: says where elements live and who may touch them.
concept  mtl::AllocatingMemorySpace
 A memory space that can allocate and free storage for T.

Typedefs

template<typename S, typename T>
using mtl::detail::space_handle_t = typename space_handle<S, T>::type
template<typename T>
using mtl::detail::memory_space_of_t = typename memory_space_of<T>::type
template<typename S>
using mtl::detail::runtime_of_space_t = typename runtime_of_space<S>::type

Variables

template<typename S>
constexpr bool mtl::host_accessible_v
 Whether host code may read and write elements in space S; false for a type that is not a MemorySpace.