|
|
| GpuView ()=default |
| | Default constructor that will initialize cublas and allocate 0 bytes of memory.
|
| |
| | GpuView (std::vector< T > &data) |
| | constructor based on std::vectors, this will make a view on the CPU More...
|
| |
| __host__ __device__ T & | operator[] (size_t idx) |
| | operator[] to retrieve a reference to an item in the buffer More...
|
| |
| __host__ __device__ T | operator[] (size_t idx) const |
| | operator[] to retrieve a copy of an item in the buffer More...
|
| |
| | GpuView (T *dataOnHost, size_t numberOfElements) |
| | GpuView allocates new GPU memory of size numberOfElements * sizeof(T) and copies numberOfElements from data. More...
|
| |
|
| ~GpuView ()=default |
| | ~GpuView calls cudaFree
|
| |
| __host__ __device__ T * | data () |
| |
| __host__ __device__ const T * | data () const |
| |
| __host__ __device__ bool | empty () const |
| |
| __host__ __device__ T & | front () |
| |
| __host__ __device__ T & | back () |
| |
| __host__ __device__ T | front () const |
| |
| __host__ __device__ T | back () const |
| |
| void | copyFromHost (const T *dataPointer, size_t numberOfElements) |
| | copyFromHost copies numberOfElements from the CPU memory dataPointer More...
|
| |
| void | copyToHost (T *dataPointer, size_t numberOfElements) const |
| | copyFromHost copies numberOfElements to the CPU memory dataPointer More...
|
| |
| void | copyFromHost (const std::vector< T > &data) |
| | copyToHost copies data from an std::vector More...
|
| |
| void | copyToHost (std::vector< T > &data) const |
| | copyToHost copies data to an std::vector More...
|
| |
| __host__ __device__ size_t | size () const |
| | size returns the size (number of T elements) in the vector More...
|
| |
| std::vector< T > | asStdVector () const |
| | creates an std::vector of the same size and copies the GPU data to this std::vector More...
|
| |
| __host__ __device__ iterator | begin () |
| | Get an iterator pointing to the first element of the buffer. More...
|
| |
| __host__ __device__ iterator | begin () const |
| | Get a const iterator pointing to the first element of the buffer. More...
|
| |
| __host__ __device__ iterator | end () |
| | Get an iterator pointing to the address after the last element of the buffer. More...
|
| |
| __host__ __device__ iterator | end () const |
| | Get a const iterator pointing to the address after the last element of the buffer. More...
|
| |
template<typename T>
class Opm::gpuistl::GpuView< T >
The GpuView class is provides a view of some data allocated on the GPU Essenstially is only stores a pointer and a size.
This class supports being used from inside a CUDA/HIP Kernel. Implementations are placed in this headerfile for functions that may be called inside a kernel to avoid expensive RDC (relocatable device code)
The view will typically provide a view into a GpuBuffer and be able to manipulate the data within it
- Parameters
-
| T | Type of the data we store, typically int/float/double w/o const specifier |