SyTen
syten::Cuda::CudaMutSpan< T > Class Template Reference

CudaMutSpan is a non-owning reference to a continuous array of objects in CUDA storage which can be mutated through the span. More...

#include <cuda_span.h>

+ Collaboration diagram for syten::Cuda::CudaMutSpan< T >:

Public Member Functions

CudaPtr< T > begin ()
 Returns a pointer to the beginning of the region. More...
 
CudaPtr< const T > begin () const
 Returns a pointer-to-const to the beginning of the region. More...
 
 CudaMutSpan ()=default
 Default ctor, initialises an empty region. More...
 
 CudaMutSpan (CudaDynArray< T > &c)
 Standard ctor. More...
 
 CudaMutSpan (CudaMutSpan< T > const &)=default
 Copy ctor. More...
 
 CudaMutSpan (CudaPtr< T > ptr_, std::size_t len)
 Alternative ctor, takes a pointer and a length. More...
 
CudaPtr< T > end ()
 Returns a pointer to one past the end of the region. More...
 
CudaPtr< const T > end () const
 Returns a pointer-to-const to one past the end of the region. More...
 
std::size_t size () const
 Returns the size of the region. More...
 

Private Attributes

CudaPtr< T > ptr {nullptr, -1}
 Pointer to the start of the region. More...
 
std::size_t sz {0}
 Number of Ts in the region. More...
 

Detailed Description

template<typename T>
class syten::Cuda::CudaMutSpan< T >

CudaMutSpan is a non-owning reference to a continuous array of objects in CUDA storage which can be mutated through the span.

The region from which CudaMutSpan has been initialised needs to live throughout the span's lifetime. It is not possible to extend or shrink the region, but each element in it can be modified through the span.

CudaMutSpans can be created either using a reference to a suitable container with a value_type member typedef or a plain pointer/size pair.

Remarks
Functionally, this is quite similar to a pair of random access iterators ‘begin’ and ‘end’.
Template Parameters
Tthe type of the objects in the region of memory.

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