13#ifndef CudaInterface_h
14#define CudaInterface_h
24#define ERRCHECK(err) RooBatchCompute::CudaInterface::checkCudaErrors((err), __func__, __FILE__, __LINE__)
27namespace CudaInterface {
34 throw std::runtime_error(
errMsg.str());
52namespace CudaInterface {
58 void operator()(
void *ptr);
72 inline cudaStream_t *get() {
return reinterpret_cast<cudaStream_t *&
>(
_ptr); }
73 inline operator cudaStream_t() {
return *
reinterpret_cast<cudaStream_t *
>(
_ptr.get()); }
76 std::unique_ptr<void, Deleter<CudaStream>>
_ptr;
136 std::size_t
size()
const {
return _size; }
137 void *
data() {
return _data.get(); }
138 void const *
data()
const {
return _data.get(); }
141 std::unique_ptr<void, Deleter<DeviceMemory>> _data;
142 std::size_t _size = 0;
149 std::size_t
size()
const {
return _size; }
150 void *
data() {
return _data.get(); }
151 void const *
data()
const {
return _data.get(); }
154 std::unique_ptr<void, Deleter<PinnedHostMemory>> _data;
155 std::size_t _size = 0;
170template <
class Data_t,
class Memory_t>
186 inline std::size_t
size()
const {
return Memory_t::size(); }
204 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
ROOT::Detail::TRangeCast< T, true > TRangeDynCast
TRangeDynCast is an adapter class that allows the typed iteration through a TCollection.
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 dest
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t src
A templated class for managing an array of data using a specified memory type.
Array(std::size_t n)
Constructor to create an Array object with a specified size.
Data_t * data()
Get a pointer to the start of the array.
Data_t const * data() const
Get a const pointer to the start of the array.
std::size_t size() const
Get the size of the array.
CudaStream()
Creates a new CUDA stream.
std::unique_ptr< void, Deleter< CudaStream > > _ptr
void copyDeviceToDevice(const T *src, T *dest, std::size_t n, CudaStream *stream=nullptr)
Copies data from the CUDA device to the CUDA device.
void copyHostToDevice(const T *src, T *dest, std::size_t n, CudaStream *stream=nullptr)
Copies data from the host to the CUDA device.
void copyDeviceToHost(const T *src, T *dest, std::size_t n, CudaStream *stream=nullptr)
Copies data from the CUDA device to the host.
Namespace for dispatching RooFit computations to various backends.