MTL5 -- Matrix Template Library C++ API
mtl:: -- C++20 header-only linear algebra for mixed-precision algorithm design
Loading...
Searching...
No Matches
mtl::memory_space::pinned< R > Struct Template Reference

Host memory page-locked by R, so transfers to and from R's devices can be DMA'd. More...

#include <memory_space.hpp>

Public Types

using runtime = R
template<typename T>
using handle_type = T*

Static Public Member Functions

template<typename T>
requires requires(std::size_t n) { { R::template allocate_pinned<T>(n) } -> std::same_as<T*>; }
static T * allocate (std::size_t n)
template<typename T>
requires requires(T* p, std::size_t n) { R::template deallocate_pinned<T>(p, n); }
static void deallocate (T *p, std::size_t n) noexcept

Static Public Attributes

static constexpr bool host_accessible = true
static constexpr bool device_accessible = false
static constexpr const char * name = "pinned"

Detailed Description

template<typename R = runtime::preferred>
struct mtl::memory_space::pinned< R >

Host memory page-locked by R, so transfers to and from R's devices can be DMA'd.

The host touches it like any host memory; kernels do not. It is host memory, so its handle is always a pointer.

Member Typedef Documentation

◆ handle_type

template<typename R = runtime::preferred>
template<typename T>
using mtl::memory_space::pinned< R >::handle_type = T*

◆ runtime

template<typename R = runtime::preferred>
using mtl::memory_space::pinned< R >::runtime = R

Member Function Documentation

◆ allocate()

template<typename R = runtime::preferred>
template<typename T>
requires requires(std::size_t n) { { R::template allocate_pinned<T>(n) } -> std::same_as<T*>; }
T * mtl::memory_space::pinned< R >::allocate ( std::size_t n)
inlinestaticnodiscard

◆ deallocate()

template<typename R = runtime::preferred>
template<typename T>
requires requires(T* p, std::size_t n) { R::template deallocate_pinned<T>(p, n); }
void mtl::memory_space::pinned< R >::deallocate ( T * p,
std::size_t n )
inlinestaticnoexcept

Member Data Documentation

◆ device_accessible

template<typename R = runtime::preferred>
bool mtl::memory_space::pinned< R >::device_accessible = false
staticconstexpr

◆ host_accessible

template<typename R = runtime::preferred>
bool mtl::memory_space::pinned< R >::host_accessible = true
staticconstexpr

◆ name

template<typename R = runtime::preferred>
const char* mtl::memory_space::pinned< R >::name = "pinned"
staticconstexpr

The documentation for this struct was generated from the following file: