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

Scoped read/write access to a CUDA buffer on one stream. More...

#include <buffer.hpp>

Public Types

using element_type = T
 

Public Member Functions

T * data () const noexcept
 Return the typed device pointer for mutating CUDA work.
 
WriteAccess & operator= (WriteAccess &&other) noexcept
 
WriteAccess & operator= (WriteAccess const &)=delete
 
void release () noexcept
 Publish this write 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 > & 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.
 
 WriteAccess (WriteAccess &&other) noexcept
 
 WriteAccess (WriteAccess const &)=delete
 
 ~WriteAccess ()
 

Friends

class CudaBuffer< T >
 

Detailed Description

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

Scoped read/write access to a CUDA buffer on one stream.

The constructor installs predecessor waits on the stream. The destructor records an exclusive-writer completion at the current stream tail and publishes it back to the buffer.

Member Typedef Documentation

◆ element_type

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

Constructor & Destructor Documentation

◆ WriteAccess() [1/2]

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

◆ WriteAccess() [2/2]

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

◆ ~WriteAccess()

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

Member Function Documentation

◆ data()

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

Return the typed device pointer for mutating CUDA work.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ release()

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

Publish this write completion and end the scoped access.

◆ release_after_synchronization()

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

End access after the caller has synchronized the operation stream.

◆ release_with_completion()

template<typename T >
void uni20::cuda::WriteAccess< 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::WriteAccess< T >::size ( ) const
inlinenoexcept

Return the number of typed elements in the view.

◆ size_bytes()

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

Return the number of bytes in the view.

◆ storage() [1/2]

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

Return the mutable CUDA buffer retained by this access object.

◆ storage() [2/2]

template<typename T >
CudaBuffer< T > const & uni20::cuda::WriteAccess< 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: