Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | List of all members
uni20::cuda::CudaPointerAccessor< ElementType > Struct Template Reference

Accessor for a CUDA mdspan whose device pointer has been leased. More...

#include <cuda_accessor.hpp>

Public Types

using data_handle_type = element_type *
 
using element_type = ElementType
 
using offset_policy = CudaPointerAccessor
 
using offset_type = std::size_t
 
using reference = element_type &
 

Public Member Functions

UNI20_HOST_DEVICE constexpr reference access (data_handle_type handle, offset_type offset) const noexcept
 
UNI20_HOST_DEVICE constexpr data_handle_type offset (data_handle_type handle, offset_type offset) const noexcept
 

Detailed Description

template<class ElementType>
requires std::is_trivially_copyable_v<ElementType>
struct uni20::cuda::CudaPointerAccessor< ElementType >

Accessor for a CUDA mdspan whose device pointer has been leased.

Indexed access applies the mapped offset and returns an element reference. The accessor must be evaluated only in an execution domain where the leased CUDA pointer is directly accessible. Persistent elements must be trivially copyable, including borrowed views.

Member Typedef Documentation

◆ data_handle_type

template<class ElementType >
using uni20::cuda::CudaPointerAccessor< ElementType >::data_handle_type = element_type*

◆ element_type

template<class ElementType >
using uni20::cuda::CudaPointerAccessor< ElementType >::element_type = ElementType

◆ offset_policy

template<class ElementType >
using uni20::cuda::CudaPointerAccessor< ElementType >::offset_policy = CudaPointerAccessor

◆ offset_type

template<class ElementType >
using uni20::cuda::CudaPointerAccessor< ElementType >::offset_type = std::size_t

◆ reference

template<class ElementType >
using uni20::cuda::CudaPointerAccessor< ElementType >::reference = element_type&

Member Function Documentation

◆ access()

template<class ElementType >
UNI20_HOST_DEVICE constexpr reference uni20::cuda::CudaPointerAccessor< ElementType >::access ( data_handle_type  handle,
offset_type  offset 
) const
inlineconstexprnoexcept

◆ offset()

template<class ElementType >
UNI20_HOST_DEVICE constexpr data_handle_type uni20::cuda::CudaPointerAccessor< ElementType >::offset ( data_handle_type  handle,
offset_type  offset 
) const
inlineconstexprnoexcept

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