ROOT 6.14/05 Reference Guide |
Service class for on-device memory buffers. Uses std::shared_pointer with custom destructor to ensure consistent memory management and allow for easy copying/moving. A device buffer has an associated CUDA compute stream , which is used for implicit synchronization of data transfers.
AFloat | The floating point type to be stored in the buffers. |
Definition at line 28 of file CudaBuffers.h.
Classes | |
struct | TDestructor |
Public Member Functions | |
TCudaDeviceBuffer (size_t size) | |
TCudaDeviceBuffer (size_t size, cudaStream_t stream) | |
TCudaDeviceBuffer (AFloat *, size_t size, cudaStream_t stream) | |
TCudaDeviceBuffer ()=default | |
TCudaDeviceBuffer (const TCudaDeviceBuffer &)=default | |
TCudaDeviceBuffer (TCudaDeviceBuffer &&)=default | |
void | CopyFrom (const TCudaHostBuffer< AFloat > &) const |
void | CopyTo (const TCudaHostBuffer< AFloat > &) const |
cudaStream_t | GetComputeStream () const |
TCudaDeviceBuffer | GetSubBuffer (size_t offset, size_t size) |
Return sub-buffer of the current buffer. More... | |
operator AFloat * () const | |
Convert to raw device data pointer. More... | |
TCudaDeviceBuffer & | operator= (const TCudaDeviceBuffer &)=default |
TCudaDeviceBuffer & | operator= (TCudaDeviceBuffer &&)=default |
void | SetComputeStream (cudaStream_t stream) |
Private Attributes | |
cudaStream_t | fComputeStream |
cudaStream for data transfer More... | |
struct TMVA::DNN::TCudaDeviceBuffer::TDestructor | fDestructor |
std::shared_ptr< AFloat * > | fDevicePointer |
Pointer to the buffer data. More... | |
size_t | fOffset |
Offset for sub-buffers. More... | |
size_t | fSize |
#include <TMVA/DNN/Architectures/Cuda/CudaBuffers.h>
TMVA::DNN::TCudaDeviceBuffer< AFloat >::TCudaDeviceBuffer | ( | size_t | size | ) |
Definition at line 77 of file CudaBuffers.cxx.
TMVA::DNN::TCudaDeviceBuffer< AFloat >::TCudaDeviceBuffer | ( | size_t | size, |
cudaStream_t | stream | ||
) |
Definition at line 87 of file CudaBuffers.cxx.
TMVA::DNN::TCudaDeviceBuffer< AFloat >::TCudaDeviceBuffer | ( | AFloat * | devicePointer, |
size_t | size, | ||
cudaStream_t | stream | ||
) |
Definition at line 97 of file CudaBuffers.cxx.
|
default |
|
default |
|
default |
void TMVA::DNN::TCudaDeviceBuffer< AFloat >::CopyFrom | ( | const TCudaHostBuffer< AFloat > & | buffer | ) | const |
Definition at line 124 of file CudaBuffers.cxx.
void TMVA::DNN::TCudaDeviceBuffer< AFloat >::CopyTo | ( | const TCudaHostBuffer< AFloat > & | buffer | ) | const |
Definition at line 132 of file CudaBuffers.cxx.
|
inline |
Definition at line 137 of file CudaBuffers.h.
TCudaDeviceBuffer< AFloat > TMVA::DNN::TCudaDeviceBuffer< AFloat >::GetSubBuffer | ( | size_t | offset, |
size_t | size | ||
) |
Return sub-buffer of the current buffer.
Definition at line 107 of file CudaBuffers.cxx.
TMVA::DNN::TCudaDeviceBuffer< AFloat >::operator AFloat * | ( | ) | const |
Convert to raw device data pointer.
Definition at line 117 of file CudaBuffers.cxx.
|
default |
|
default |
|
inline |
Definition at line 138 of file CudaBuffers.h.
|
private |
cudaStream for data transfer
Definition at line 103 of file CudaBuffers.h.
|
private |
|
private |
Pointer to the buffer data.
Definition at line 104 of file CudaBuffers.h.
|
private |
Offset for sub-buffers.
Definition at line 101 of file CudaBuffers.h.
|
private |
Definition at line 102 of file CudaBuffers.h.