Project
Loading...
Searching...
No Matches
GPUO2ConfigurableParam.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// This file auto-generates a ConfigurableParam object from the GPU parameter macros.
16// Set via:
17// --configKeyValues "GPU_global.[x]=[y]" : for global GPU run configurations, like solenoidBz, gpuType, configuration object files.
18// --configKeyValues "GPU_rec.[x]=[y]" : for GPU reconstruction related settings used on the GPU, like pt threshold for track rejection.
19// --configKeyValues "GPU_proc.[x]=[y]" : for processing options steering GPU reconstruction like GPU device ID, debug output level, number of CPU threads.
20// Check GPUSettingsList.h for all options
21
22#ifndef GPUO2CONFIGURABLEPARAM_H
23#define GPUO2CONFIGURABLEPARAM_H
24
25#include "GPUO2ExternalUser.h"
28#include "GPUSettings.h"
29#include "GPUDefMacros.h"
30#include <vector>
31
32// clang-format off
33#define BeginNamespace(name) \
34 namespace name \
35 {
36#define EndNamespace() }
37#define AddOption(name, type, default, optname, optnameshort, help, ...) type name = default;
38#define AddOptionRTC(...) AddOption(__VA_ARGS__)
39#define AddVariable(name, type, default)
40#define AddVariableRTC(...) AddVariable(__VA_ARGS__)
41#define AddOptionSet(name, type, value, optname, optnameshort, help, ...)
42#define AddOptionVec(name, type, optname, optnameshort, help, ...)
43#define AddOptionArray(name, type, count, default, optname, optnameshort, help, ...) type name[count] = {GPUCA_M_STRIP(default)};
44#define AddSubConfig(name, instance)
45#define BeginSubConfig(name, instance, parent, preoptname, preoptnameshort, descr, o2prefix) \
46 namespace internal \
47 { \
48 struct GPUCA_M_CAT(GPUConfigurableParam, name) : public o2::conf::ConfigurableParamHelper<GPUCA_M_CAT(GPUConfigurableParam, name)> { \
49 O2ParamDef(GPUCA_M_CAT(GPUConfigurableParam, name), GPUCA_M_STR(GPUCA_M_CAT(GPU_, o2prefix))) public:
50#define BeginHiddenConfig(name, instance) \
51 namespace internal \
52 { \
53 struct GPUCA_M_CAT(GPUConfigurableParam, name) {
54#define EndConfig() \
55 }; \
56 } // namespace internal
57#define AddCustomCPP(...) __VA_ARGS__
58#define AddHelp(...)
59#define AddShortcut(...)
60#define AddOptionRTC(...) AddOption(__VA_ARGS__)
61#define AddOptionArrayRTC(...) AddOptionArray(__VA_ARGS__)
62#include "GPUSettingsList.h"
63#undef BeginNamespace
64#undef EndNamespace
65#undef AddOption
66#undef AddOptionRTC
67#undef AddVariable
68#undef AddVariableRTC
69#undef AddOptionSet
70#undef AddOptionVec
71#undef AddOptionArray
72#undef AddOptionArrayRTC
73#undef AddSubConfig
74#undef BeginSubConfig
75#undef BeginHiddenConfig
76#undef EndConfig
77#undef AddCustomCPP
78#undef AddHelp
79#undef AddShortcut
80// clang-format on
81
82#endif