Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
Buffers.h
Go to the documentation of this file.
1/*
2 * Project: RooFit
3 * Authors:
4 * Jonas Rembser, CERN 11/2021
5 *
6 * Copyright (c) 2021, CERN
7 *
8 * Redistribution and use in source and binary forms,
9 * with or without modification, are permitted according to the terms
10 * listed in LICENSE (http://roofit.sourceforge.net/license.txt)
11 */
12
13#ifndef RooFit_Detail_Buffers_h
14#define RooFit_Detail_Buffers_h
15
16#include <RConfig.h>
17
18#ifdef ROOFIT_CUDA
20#endif
21
22#include <cstddef>
23#include <memory>
24
25#include <memory>
26
27namespace RooFit {
28namespace Detail {
29
30class AbsBuffer {
31public:
32 virtual ~AbsBuffer() = default;
33
34 virtual double const *cpuReadPtr() const = 0;
35 virtual double const *gpuReadPtr() const = 0;
36
37 virtual double *cpuWritePtr() = 0;
38 virtual double *gpuWritePtr() = 0;
39};
40
41struct BufferQueuesMaps;
42
44
45public:
48
49 std::unique_ptr<AbsBuffer> makeScalarBuffer();
50 std::unique_ptr<AbsBuffer> makeCpuBuffer(std::size_t size);
51#ifdef ROOFIT_CUDA
52 std::unique_ptr<AbsBuffer> makeGpuBuffer(std::size_t size);
53 std::unique_ptr<AbsBuffer>
54 makePinnedBuffer(std::size_t size, RooFit::Detail::CudaInterface::CudaStream *stream = nullptr);
55#endif
56
57private:
58 std::unique_ptr<BufferQueuesMaps> _queuesMaps;
59};
60
61} // end namespace Detail
62} // end namespace RooFit
63
64#endif
size_t size(const MatrixT &matrix)
retrieve the size of a square matrix
virtual double * cpuWritePtr()=0
virtual ~AbsBuffer()=default
virtual double const * gpuReadPtr() const =0
virtual double const * cpuReadPtr() const =0
virtual double * gpuWritePtr()=0
std::unique_ptr< AbsBuffer > makeScalarBuffer()
Definition Buffers.cxx:199
std::unique_ptr< BufferQueuesMaps > _queuesMaps
Definition Buffers.h:58
std::unique_ptr< AbsBuffer > makeCpuBuffer(std::size_t size)
Definition Buffers.cxx:203
The namespace RooFit contains mostly switches that change the behaviour of functions of PDFs (or othe...
Definition JSONIO.h:26