Skip to content

Commit b42533c

Browse files
committed
GPU: Can load GPUSettingsList.h - like structs from multiple files
1 parent 3afbc90 commit b42533c

4 files changed

Lines changed: 29 additions & 19 deletions

File tree

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
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 GPUSettingsParam.h
13+
/// \author David Rohr
14+
15+
// clang-format off
16+
17+
// Derrived parameters used in GPUParam
18+
BeginHiddenConfig(GPUSettingsParam, param)
19+
AddVariableRTC(continuousTracking, int8_t, 0) // Continuous tracking, estimate bz and errors for abs(z) = 125cm during seeding
20+
AddVariableRTC(dodEdx, int8_t, 0) // Do dEdx computation
21+
EndConfig()

‎GPU/GPUTracking/Definitions/GPUSettingsList.h‎

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,20 +19,13 @@
1919
// Create plain-C struct for GPU code.
2020
// Create static constexpr with default values for GPU run time compilation
2121

22-
#include "GPUCommonDef.h"
22+
#ifdef BeginConfig // File should not be included without defining the macros, but rootcling will do for dictionary generation
2323
#ifndef GPUSETTINGS_H
2424
#error Please include GPUSettings.h!
2525
#endif
2626

2727
// clang-format off
2828

29-
#ifdef QCONFIG_INSTANCE
30-
using namespace o2::gpu;
31-
#endif
32-
#ifdef BeginNamespace // File should not be included without defining the macros, but rootcling will do for dictionary generation
33-
BeginNamespace(o2)
34-
BeginNamespace(gpu)
35-
3629
// Settings concerning the reconstruction, stored as parameters in GPU constant memory
3730
// There must be no bool in here, use int8_t, as sizeof(bool) is compiler dependent and fails on GPUs!!!!!!
3831
// Split in different blocks for global and per Detector
@@ -719,14 +712,4 @@ EndConfig()
719712
#endif // !GPUCA_STANDALONE
720713
#endif // !GPUCA_GPUCODE_DEVICE
721714

722-
// Derrived parameters used in GPUParam
723-
BeginHiddenConfig(GPUSettingsParam, param)
724-
AddVariableRTC(continuousTracking, int8_t, 0) // Continuous tracking, estimate bz and errors for abs(z) = 125cm during seeding
725-
AddVariableRTC(dodEdx, int8_t, 0) // Do dEdx computation
726-
EndConfig()
727-
728-
EndNamespace() // gpu
729-
EndNamespace() // o2
730-
#endif // #ifdef BeginNamespace
731-
732-
// clang-format on
715+
#endif // #ifndef __CLING__

‎GPU/GPUTracking/qconfigoptions.h‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,9 @@
1414

1515
#include "GPUSettings.h" // Usually we are included from GPUSettings.h, so this doesn't do anything.
1616
// But ROOT or qconfig.cpp will include us directly, so load the settings first.
17+
18+
// clang-format off
19+
BeginNamespace(o2::gpu)
1720
#include "GPUSettingsList.h"
21+
#include "GPUSettingsParam.h"
22+
EndNamespace() // o2::gpu

‎GPU/GPUTracking/utils/qconfig_internal.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -208,6 +208,7 @@ void qConfigPrint(const T& qconfig_tmp_object, const std::string& blockName); //
208208
// End QCONFIG_PRINT
209209
#elif defined(QCONFIG_INSTANCE)
210210
#define BeginNamespace(name) \
211+
using namespace name; \
211212
namespace name \
212213
{
213214
#define EndNamespace() }

0 commit comments

Comments
 (0)