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
25namespace RooFit {
26namespace Detail {
27
28class AbsBuffer {
29public:
30 virtual ~AbsBuffer() = default;
31
32 virtual double const *cpuReadPtr() const = 0;
33 virtual double const *gpuReadPtr() const = 0;
34
35 virtual double *cpuWritePtr() = 0;
36 virtual double *gpuWritePtr() = 0;
37};
38
39struct BufferQueuesMaps;
40
42
43public:
46
47 std::unique_ptr<AbsBuffer> makeScalarBuffer();
48 std::unique_ptr<AbsBuffer> makeCpuBuffer(std::size_t size);
49#ifdef ROOFIT_CUDA
50 std::unique_ptr<AbsBuffer> makeGpuBuffer(std::size_t size);
51 std::unique_ptr<AbsBuffer>
52 makePinnedBuffer(std::size_t size, RooFit::Detail::CudaInterface::CudaStream *stream = nullptr);
53#endif
54
55private:
56 std::unique_ptr<BufferQueuesMaps> _queuesMaps;
57};
58
59} // end namespace Detail
60} // end namespace RooFit
61
62#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:56
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