Project
Loading...
Searching...
No Matches
GPUReconstructionOCL.h
Go to the documentation of this file.
1// Copyright 2019-2020 CERN and copyright holders of ALICE O2.
2// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders.
3// All rights not expressly granted are reserved.
4//
5// This software is distributed under the terms of the GNU General Public
6// License v3 (GPL Version 3), copied verbatim in the file "COPYING".
7//
8// In applying this license CERN does not waive the privileges and immunities
9// granted to it by virtue of its status as an Intergovernmental Organization
10// or submit itself to any jurisdiction.
11
14
15#ifndef GPURECONSTRUCTIONOCL_H
16#define GPURECONSTRUCTIONOCL_H
17
19
20#ifdef _WIN32
22#else
24#endif
25
26namespace o2::gpu
27{
28struct GPUReconstructionOCLInternals;
29
31{
32 public:
34
35 protected:
37
38 int32_t InitDevice_Runtime() override;
39 int32_t ExitDevice_Runtime() override;
41
42 int32_t GPUFailedMsgAI(const int64_t error, const char* file, int32_t line);
43 void GPUFailedMsgA(const int64_t error, const char* file, int32_t line);
44
45 void SynchronizeGPU() override;
46 int32_t DoStuckProtection(int32_t stream, deviceEvent event) override;
47 int32_t GPUDebug(const char* state = "UNKNOWN", int32_t stream = -1, bool force = false) override;
48 void SynchronizeStream(int32_t stream) override;
49 void SynchronizeEvents(deviceEvent* evList, int32_t nEvents = 1) override;
50 void StreamWaitForEvents(int32_t stream, deviceEvent* evList, int32_t nEvents = 1) override;
51 bool IsEventDone(deviceEvent* evList, int32_t nEvents = 1) override;
52
53 size_t WriteToConstantMemory(size_t offset, const void* src, size_t size, int32_t stream = -1, deviceEvent* ev = nullptr) override;
54 size_t GPUMemCpy(void* dst, const void* src, size_t size, int32_t stream, int32_t toGPU, deviceEvent* ev = nullptr, deviceEvent* evList = nullptr, int32_t nEvents = 1) override;
55 void ReleaseEvent(deviceEvent ev) override;
56 void RecordMarker(deviceEvent* ev, int32_t stream) override;
57
58 template <class T, int32_t I = 0>
59 int32_t AddKernel(bool multi = false);
60 template <class T, int32_t I = 0>
61 uint32_t FindKernel(int32_t num);
62 template <typename K, typename... Args>
63 int32_t runKernelBackendInternal(const krnlSetupTime& _xyz, K& k, const Args&... args);
64 template <class T, int32_t I = 0>
66
69
70 template <class T, int32_t I = 0, typename... Args>
72 template <class S, class T, int32_t I, bool MULTI>
74
75 int32_t GetOCLPrograms();
76};
77
79} // namespace o2::gpu
80
81#endif
benchmark::State & state
o2::gpu::GPUReconstruction * GPUReconstruction_Create_OCL(const o2::gpu::GPUSettingsDeviceBackend &cfg)
double num
void SynchronizeStream(int32_t stream) override
int32_t runKernelBackend(const krnlSetupArgs< T, I, Args... > &args)
int32_t GPUFailedMsgAI(const int64_t error, const char *file, int32_t line)
int32_t GPUDebug(const char *state="UNKNOWN", int32_t stream=-1, bool force=false) override
void RecordMarker(deviceEvent *ev, int32_t stream) override
size_t WriteToConstantMemory(size_t offset, const void *src, size_t size, int32_t stream=-1, deviceEvent *ev=nullptr) override
size_t GPUMemCpy(void *dst, const void *src, size_t size, int32_t stream, int32_t toGPU, deviceEvent *ev=nullptr, deviceEvent *evList=nullptr, int32_t nEvents=1) override
int32_t runKernelBackendInternal(const krnlSetupTime &_xyz, K &k, const Args &... args)
void GPUFailedMsgA(const int64_t error, const char *file, int32_t line)
GPUReconstructionOCLInternals * mInternals
void SynchronizeEvents(deviceEvent *evList, int32_t nEvents=1) override
int32_t DoStuckProtection(int32_t stream, deviceEvent event) override
void ReleaseEvent(deviceEvent ev) override
gpu_reconstruction_kernels::krnlProperties getKernelPropertiesBackend()
void StreamWaitForEvents(int32_t stream, deviceEvent *evList, int32_t nEvents=1) override
bool IsEventDone(deviceEvent *evList, int32_t nEvents=1) override
struct _cl_event * event
Definition glcorearb.h:2982
GLenum src
Definition glcorearb.h:1767
GLsizeiptr size
Definition glcorearb.h:659
GLenum GLenum dst
Definition glcorearb.h:1767
GLintptr offset
Definition glcorearb.h:660
GLuint GLuint stream
Definition glcorearb.h:1806
const int nEvents
Definition test_Fifo.cxx:27