13#ifndef RooFit_Detail_CudaInterface_h
14#define RooFit_Detail_CudaInterface_h
49 inline operator cudaEvent_t() {
return *
reinterpret_cast<cudaEvent_t *
>(
_ptr.get()); }
52 std::unique_ptr<void, Deleter<CudaEvent>>
_ptr;
67 inline cudaStream_t *get() {
return reinterpret_cast<cudaStream_t *&
>(
_ptr); }
68 inline operator cudaStream_t() {
return *
reinterpret_cast<cudaStream_t *
>(
_ptr.get()); }
71 std::unique_ptr<void, Deleter<CudaStream>>
_ptr;
78void copyHostToDeviceImpl(
const void *
src,
void *
dest, std::size_t
n,
CudaStream * =
nullptr);
79void copyDeviceToHostImpl(
const void *
src,
void *
dest, std::size_t
n,
CudaStream * =
nullptr);
93 copyHostToDeviceImpl(
src,
dest,
sizeof(T) *
n);
107 copyDeviceToHostImpl(
src,
dest,
sizeof(T) *
n);
117 DeviceMemory(std::size_t
n, std::size_t typeSize);
119 std::size_t
size()
const {
return _size; }
120 void *
data() {
return _data.get(); }
121 void const *
data()
const {
return _data.get(); }
124 std::unique_ptr<void, Deleter<DeviceMemory>> _data;
125 std::size_t _size = 0;
128class PinnedHostMemory {
130 PinnedHostMemory(std::size_t
n, std::size_t typeSize);
132 std::size_t
size()
const {
return _size; }
133 void *
data() {
return _data.get(); }
134 void const *
data()
const {
return _data.get(); }
137 std::unique_ptr<void, Deleter<PinnedHostMemory>> _data;
138 std::size_t _size = 0;
154template <
class Data_t,
class Memory_t>
170 inline std::size_t
size()
const {
return Memory_t::size(); }
179 inline Data_t *
data() {
return static_cast<Data_t *
>(Memory_t::data()); }
188 inline Data_t
const *
data()
const {
return static_cast<Data_t
const *
>(Memory_t::data()); }
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void data
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
TRObject operator()(const T1 &t1) const
A templated class for managing an array of data using a specified memory type.
Data_t const * data() const
Get a const pointer to the start of the array.
Data_t * data()
Get a pointer to the start of the array.
std::size_t size() const
Get the size of the array.
Array(std::size_t n)
Constructor to create an Array object with a specified size.
std::unique_ptr< void, Deleter< CudaEvent > > _ptr
CudaStream()
Creates a new CUDA stream.
std::unique_ptr< void, Deleter< CudaStream > > _ptr
void waitForEvent(CudaEvent &)
Makes a CUDA stream wait for a CUDA event.
bool isActive()
Checks if a CUDA stream is currently active.
void cudaEventRecord(CudaEvent &, CudaStream &)
Records a CUDA event.
void copyDeviceToHost(const T *src, T *dest, std::size_t n, CudaStream *=nullptr)
Copies data from the CUDA device to the host.
void copyHostToDevice(const T *src, T *dest, std::size_t n, CudaStream *=nullptr)
Copies data from the host to the CUDA device.
float cudaEventElapsedTime(CudaEvent &, CudaEvent &)
Calculates the elapsed time between two CUDA events.
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
#define dest(otri, vertexptr)