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

Scoped read/write CUDA pointer access after a host-side synchronization. More...

#include <buffer.hpp>

Public Types

using element_type = T
 

Public Member Functions

 BlockingWriteAccess (BlockingWriteAccess &&other) noexcept
 
 BlockingWriteAccess (BlockingWriteAccess const &)=delete
 
T * data () const noexcept
 Return the typed device pointer for a blocking runtime operation.
 
BlockingWriteAccess & operator= (BlockingWriteAccess &&other) noexcept
 
BlockingWriteAccess & operator= (BlockingWriteAccess const &)=delete
 
void release () noexcept
 End the scoped host-synchronized write access.
 
void release_with_completion (Completion completion) noexcept
 Publish externally submitted device completion and end the scoped access.
 
std::size_t size () const noexcept
 Return the number of typed elements in the allocation.
 
CudaBuffer< T > & storage ()
 Return the mutable CUDA buffer retained by this access object.
 
CudaBuffer< T > const & storage () const
 Return the read-only CUDA buffer retained by this access object.
 
 ~BlockingWriteAccess ()
 

Friends

class CudaBuffer< T >
 

Detailed Description

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

Scoped read/write CUDA pointer access after a host-side synchronization.

Construction waits for all prior reader and writer completions. Release publishes no CUDA event because the guarded operation must have completed synchronously on the host.

Member Typedef Documentation

◆ element_type

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

Constructor & Destructor Documentation

◆ BlockingWriteAccess() [1/2]

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

◆ BlockingWriteAccess() [2/2]

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

◆ ~BlockingWriteAccess()

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

Member Function Documentation

◆ data()

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

Return the typed device pointer for a blocking runtime operation.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ release()

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

End the scoped host-synchronized write access.

◆ release_with_completion()

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

Publish externally submitted device completion and end the scoped access.

Use this when a blocking host operation has finished consuming its host operands but leaves ordered device work outstanding.

◆ size()

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

Return the number of typed elements in the allocation.

◆ storage() [1/2]

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

Return the mutable CUDA buffer retained by this access object.

◆ storage() [2/2]

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

Return the read-only 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: