Skip to content

Commit 396dc28

Browse files
committed
Add getter for individual GPU configKeyValues
1 parent ca0d86d commit 396dc28

File tree

1 file changed

+37
-0
lines changed

1 file changed

+37
-0
lines changed
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
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+
12+
/// \file GPUO2InterfaceConfiguration.inc
13+
/// \author David Rohr
14+
15+
// Note, this must potentionally be included first, before other GPU headers!
16+
// Do not include in .h files!
17+
18+
#ifndef GPUO2INTERFACECONFIGURATIONINC_H
19+
#define GPUO2INTERFACECONFIGURATIONINC_H
20+
21+
#ifdef GPUCA_STANDALONE
22+
#define GPU_GET_CONFIG(configName) static_assert(false, "GPU_GET_CONFIG not available in standalone benchmark")
23+
#else
24+
#include "GPUO2ExternalUser.h"
25+
#include "GPUCommonRtypes.h"
26+
#include "GPUDefMacros.h"
27+
#include "GPUO2InterfaceConfiguration.h"
28+
#include "GPUO2ConfigurableParam.h"
29+
#include <type_traits>
30+
31+
#define GPU_GET_CONFIG(configName) []() -> decltype(auto) { \
32+
static_assert(!std::is_same_v<o2::gpu::configName, o2::gpu::GPUSettingsProcessing>); \
33+
return o2::gpu::GPUCA_M_CAT(GPUConfigurableParam, configName)::Instance(); \
34+
}()
35+
#endif
36+
37+
#endif

0 commit comments

Comments
 (0)