16#ifndef TMVA_DNN_ARCHITECTURES_CUDA_CUDABUFFERS
17#define TMVA_DNN_ARCHITECTURES_CUDA_CUDABUFFERS
20#include "cuda_runtime.h"
27template<
typename AFloat>
28class TCudaDeviceBuffer;
41template<
typename AFloat>
79 operator AFloat * ()
const;
98template<
typename AFloat>
134 operator AFloat * ()
const;
151template<
typename AFloat>
154 return (*fHostPointer + fOffset)[index];
157template<
typename AFloat>
160 return (*fHostPointer + fOffset)[index];
size_t fOffset
Offset for sub-buffers.
void SetComputeStream(cudaStream_t stream)
void CopyFrom(const TCudaHostBuffer< AFloat > &) const
void CopyTo(const TCudaHostBuffer< AFloat > &) const
struct TMVA::DNN::TCudaDeviceBuffer::TDestructor fDestructor
TCudaDeviceBuffer GetSubBuffer(size_t offset, size_t size)
Return sub-buffer of the current buffer.
TCudaDeviceBuffer & operator=(TCudaDeviceBuffer &&)=default
cudaStream_t fComputeStream
cudaStream for data transfer
TCudaDeviceBuffer & operator=(const TCudaDeviceBuffer &)=default
std::shared_ptr< AFloat * > fDevicePointer
Pointer to the buffer data.
TCudaDeviceBuffer()=default
TCudaDeviceBuffer(TCudaDeviceBuffer &&)=default
cudaStream_t GetComputeStream() const
size_t GetUseCount() const
TCudaDeviceBuffer(const TCudaDeviceBuffer &)=default
AFloat & operator[](size_t index)
struct TMVA::DNN::TCudaHostBuffer::TDestructor fDestructor
TCudaHostBuffer(AFloat *)
size_t fOffset
Offset for sub-buffers.
TCudaHostBuffer GetSubBuffer(size_t offset, size_t size)
Return sub-buffer of the current buffer.
TCudaHostBuffer & operator=(const TCudaHostBuffer &)=default
TCudaHostBuffer(TCudaHostBuffer &&)=default
TCudaHostBuffer()=default
cudaStream_t fComputeStream
cudaStream for data transfer
void SetConstVal(const AFloat constVal)
Sets the entire buffer to a constant value.
TCudaHostBuffer(const TCudaHostBuffer &)=default
std::shared_ptr< AFloat * > fHostPointer
Pointer to the buffer data.
TCudaHostBuffer & operator=(TCudaHostBuffer &&)=default
create variable transformations
TDestructor(const TDestructor &)=default
TDestructor(TDestructor &&)=default
void operator()(AFloat **devicePointer)
TDestructor & operator=(TDestructor &&)=default
TDestructor & operator=(const TDestructor &)=default
void operator()(AFloat **devicePointer)
TDestructor(const TDestructor &)=default
TDestructor(TDestructor &&)=default
TDestructor & operator=(TDestructor &&)=default
TDestructor & operator=(const TDestructor &)=default