ROOT 6.18/05 Reference Guide |
Wrapper class for pinned memory buffers on the host. Uses std::shared_pointer with custom destructor to ensure consistent memory management and allow for easy copying/moving of the buffers. Copying is asynchronous and will set the cudaStream of the device buffer so that subsequent computations on the device buffer can be performed on the same stream.
AFloat | The floating point type to be stored in the buffers. |
Definition at line 42 of file CudaBuffers.h.
Classes | |
struct | TDestructor |
Public Member Functions | |
TCudaHostBuffer ()=default | |
TCudaHostBuffer (AFloat *) | |
TCudaHostBuffer (const TCudaHostBuffer &)=default | |
TCudaHostBuffer (size_t size) | |
TCudaHostBuffer (TCudaHostBuffer &&)=default | |
size_t | GetSize () const |
TCudaHostBuffer | GetSubBuffer (size_t offset, size_t size) |
Return sub-buffer of the current buffer. More... | |
operator AFloat * () const | |
TCudaHostBuffer & | operator= (const TCudaHostBuffer &)=default |
TCudaHostBuffer & | operator= (TCudaHostBuffer &&)=default |
AFloat & | operator[] (size_t index) |
AFloat | operator[] (size_t index) const |
Private Attributes | |
cudaStream_t | fComputeStream |
cudaStream for data transfer More... | |
struct TMVA::DNN::TCudaHostBuffer::TDestructor | fDestructor |
std::shared_ptr< AFloat * > | fHostPointer |
Pointer to the buffer data. More... | |
size_t | fOffset |
Offset for sub-buffers. More... | |
size_t | fSize |
friend | TCudaDeviceBuffer< AFloat > |
#include <TMVA/DNN/Architectures/Cuda/CudaBuffers.h>
TMVA::DNN::TCudaHostBuffer< AFloat >::TCudaHostBuffer | ( | size_t | size | ) |
Definition at line 41 of file CudaBuffers.cxx.
TMVA::DNN::TCudaHostBuffer< AFloat >::TCudaHostBuffer | ( | AFloat * | ) |
|
default |
|
default |
|
default |
|
inline |
Definition at line 82 of file CudaBuffers.h.
TCudaHostBuffer< AFloat > TMVA::DNN::TCudaHostBuffer< AFloat >::GetSubBuffer | ( | size_t | offset, |
size_t | size | ||
) |
Return sub-buffer of the current buffer.
Definition at line 57 of file CudaBuffers.cxx.
TMVA::DNN::TCudaHostBuffer< AFloat >::operator AFloat * |
Definition at line 50 of file CudaBuffers.cxx.
|
default |
|
default |
|
inline |
Definition at line 147 of file CudaBuffers.h.
|
inline |
Definition at line 153 of file CudaBuffers.h.
|
mutableprivate |
cudaStream for data transfer
Definition at line 48 of file CudaBuffers.h.
|
private |
|
private |
Pointer to the buffer data.
Definition at line 49 of file CudaBuffers.h.
|
private |
Offset for sub-buffers.
Definition at line 46 of file CudaBuffers.h.
|
private |
Definition at line 47 of file CudaBuffers.h.
|
private |
Definition at line 62 of file CudaBuffers.h.