Uni20
Asynchronous tensor and runtime library.
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Friends | List of all members
uni20::cuda::ReadAccess< T > Class Template Reference

Scoped read-only access to a CUDA buffer on one stream. More...

#include <buffer.hpp>

Public Types

using element_type = T
 

Public Member Functions

T const * data () const noexcept
 Return the typed device pointer for read-only CUDA work.
 
ReadAccess & operator= (ReadAccess &&other) noexcept
 
ReadAccess & operator= (ReadAccess const &)=delete
 
 ReadAccess (ReadAccess &&other) noexcept
 
 ReadAccess (ReadAccess const &)=delete
 
void release () noexcept
 Publish this read completion and end the scoped access.
 
void release_after_synchronization () noexcept
 End access after the caller has synchronized the operation stream.
 
void release_with_completion (Completion completion) noexcept
 Publish a caller-recorded completion and end scoped access.
 
std::size_t size () const noexcept
 Return the number of typed elements in the view.
 
std::size_t size_bytes () const noexcept
 Return the number of bytes in the view.
 
CudaBuffer< T > const & storage () const
 Return the CUDA buffer retained by this access object.
 
 ~ReadAccess ()
 

Friends

class CudaBuffer< T >
 

Detailed Description

template<typename T>
class uni20::cuda::ReadAccess< T >

Scoped read-only access to a CUDA buffer on one stream.

The constructor installs predecessor waits on the stream. The destructor records a reader completion at the current stream tail and publishes it back to the buffer.

Member Typedef Documentation

◆ element_type

template<typename T >
using uni20::cuda::ReadAccess< T >::element_type = T

Constructor & Destructor Documentation

◆ ReadAccess() [1/2]

template<typename T >
uni20::cuda::ReadAccess< T >::ReadAccess ( ReadAccess< T > const &  )
delete

◆ ReadAccess() [2/2]

template<typename T >
uni20::cuda::ReadAccess< T >::ReadAccess ( ReadAccess< T > &&  other)
inlinenoexcept

◆ ~ReadAccess()

template<typename T >
uni20::cuda::ReadAccess< T >::~ReadAccess ( )
inline

Member Function Documentation

◆ data()

template<typename T >
T const * uni20::cuda::ReadAccess< T >::data ( ) const
inlinenoexcept

Return the typed device pointer for read-only CUDA work.

◆ operator=() [1/2]

template<typename T >
ReadAccess & uni20::cuda::ReadAccess< T >::operator= ( ReadAccess< T > &&  other)
inlinenoexcept

◆ operator=() [2/2]

template<typename T >
ReadAccess & uni20::cuda::ReadAccess< T >::operator= ( ReadAccess< T > const &  )
delete

◆ release()

template<typename T >
void uni20::cuda::ReadAccess< T >::release ( )
inlinenoexcept

Publish this read completion and end the scoped access.

◆ release_after_synchronization()

template<typename T >
void uni20::cuda::ReadAccess< T >::release_after_synchronization ( )
inlinenoexcept

End access after the caller has synchronized the operation stream.

◆ release_with_completion()

template<typename T >
void uni20::cuda::ReadAccess< T >::release_with_completion ( Completion  completion)
inlinenoexcept

Publish a caller-recorded completion and end scoped access.

◆ size()

template<typename T >
std::size_t uni20::cuda::ReadAccess< T >::size ( ) const
inlinenoexcept

Return the number of typed elements in the view.

◆ size_bytes()

template<typename T >
std::size_t uni20::cuda::ReadAccess< T >::size_bytes ( ) const
inlinenoexcept

Return the number of bytes in the view.

◆ storage()

template<typename T >
CudaBuffer< T > const & uni20::cuda::ReadAccess< T >::storage ( ) const
inline

Return the CUDA buffer retained by this access object.

Friends And Related Symbol Documentation

◆ CudaBuffer< T >

template<typename T >
friend class CudaBuffer< T >
friend

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