forked from AliceO2Group/AliceO2
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGPUCommonDef.h
More file actions
68 lines (56 loc) · 2.1 KB
/
Copy pathGPUCommonDef.h
File metadata and controls
68 lines (56 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
// Copyright CERN and copyright holders of ALICE O2. This software is
// distributed under the terms of the GNU General Public License v3 (GPL
// Version 3), copied verbatim in the file "COPYING".
//
// See http://alice-o2.web.cern.ch/license for full licensing information.
//
// In applying this license CERN does not waive the privileges and immunities
// granted to it by virtue of its status as an Intergovernmental Organization
// or submit itself to any jurisdiction.
/// \file GPUCommonDef.h
/// \author David Rohr
#ifndef GPUCOMMONDEF_H
#define GPUCOMMONDEF_H
// clang-format off
//Some GPU configuration settings, must be included first
#include "GPUCommonDefSettings.h"
#if (!defined(__OPENCL__) || defined(__OPENCLCPP__)) && (!(defined(__CINT__) || defined(__ROOTCINT__)) || defined(__CLING__)) && defined(__cplusplus) && __cplusplus >= 201103L
#define GPUCA_NOCOMPAT // C++11 + No old ROOT5 + No old OpenCL
#ifndef __OPENCL__
#define GPUCA_NOCOMPAT_ALLOPENCL // + No OpenCL at all
#endif
#ifndef __CINT__
#define GPUCA_NOCOMPAT_ALLCINT // + No ROOT CINT at all
#endif
#endif
#if !(defined(__CINT__) || defined(__ROOTCINT__) || defined(__CLING__) || defined(__ROOTCLING__) || defined(G__ROOT)) //No GPU code for ROOT
#if defined(__CUDACC__) || defined(__OPENCL__) || defined(__HIPCC__)
#define GPUCA_GPUCODE //Compiled by GPU compiler
#endif
#if defined(__CUDA_ARCH__) || defined(__OPENCL__) || defined(__HIP_DEVICE_COMPILE__)
#define GPUCA_GPUCODE_DEVICE //Executed on device
#endif
#endif
//Definitions for C++11 features not supported by CINT / OpenCL
#ifdef GPUCA_NOCOMPAT
#define CON_DELETE = delete
#define CON_DEFAULT = default
#define CONSTEXPR constexpr
#else
#define CON_DELETE
#define CON_DEFAULT
#define CONSTEXPR const
#endif
//Set AliRoot / O2 namespace
#if defined(GPUCA_STANDALONE) || defined(GPUCA_O2_LIB) || defined(GPUCA_GPULIBRARY)
#define GPUCA_ALIGPUCODE
#endif
#ifdef GPUCA_ALIROOT_LIB
#define GPUCA_NAMESPACE AliGPU
#else
#define GPUCA_NAMESPACE o2
#endif
//API Definitions for GPU Compilation
#include "GPUCommonDefAPI.h"
// clang-format on
#endif