ROOT 6.10/09 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 41 of file CudaBuffers.h.
Classes | |
struct | TDestructor |
Public Member Functions | |
TCudaHostBuffer (size_t size) | |
TCudaHostBuffer (AFloat *) | |
TCudaHostBuffer ()=default | |
TCudaHostBuffer (const TCudaHostBuffer &)=default | |
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 37 of file CudaBuffers.cxx.
TMVA::DNN::TCudaHostBuffer< AFloat >::TCudaHostBuffer | ( | AFloat * | ) |
|
default |
|
default |
|
default |
|
inline |
Definition at line 81 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 54 of file CudaBuffers.cxx.
TMVA::DNN::TCudaHostBuffer< AFloat >::operator AFloat * | ( | ) | const |
Definition at line 47 of file CudaBuffers.cxx.
|
default |
|
default |
|
inline |
Definition at line 146 of file CudaBuffers.h.
|
inline |
Definition at line 152 of file CudaBuffers.h.
|
mutableprivate |
cudaStream for data transfer
Definition at line 47 of file CudaBuffers.h.
|
private |
|
private |
Pointer to the buffer data.
Definition at line 48 of file CudaBuffers.h.
|
private |
Offset for sub-buffers.
Definition at line 45 of file CudaBuffers.h.
|
private |
Definition at line 46 of file CudaBuffers.h.
|
private |
Definition at line 61 of file CudaBuffers.h.