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>
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 T s in the region. More... | |
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.
CudaMutSpan
s can be created either using a reference to a suitable container with a value_type
member typedef or a plain pointer/size pair.
T | the type of the objects in the region of memory. |