Skip to content

Commit a26ea67

Browse files
committed
GPU: Split GPUSettingsList.h further into groups, extract display and standalone settings / clean up some display settings
1 parent 7517448 commit a26ea67

22 files changed

Lines changed: 318 additions & 232 deletions

‎GPU/GPUTracking/Base/GPUReconstructionTimeframe.cxx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@
2424
#include "AliHLTTPCRawCluster.h"
2525
#include "TPCFastTransformPOD.h"
2626
#include "GPUO2DataTypes.h"
27+
#define GPUSETTINGS_STANDALONE
28+
#define GPUSETTINGS_DISPLAY
2729
#include "GPUSettings.h"
2830

2931
#include <cstdio>

‎GPU/GPUTracking/CMakeLists.txt‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ set(SRCS_DATATYPES DataTypes/GPUDataTypesConfig.cxx DataTypes/GPUConfigDump.cxx
6969

7070
set(HDRS_CINT_O2 Merger/GPUTPCGMTrackParam.h Merger/GPUTPCGMMergedTrack.h Merger/GPUTPCGMSectorTrack.h Merger/GPUTPCGMBorderTrack.h TRDTracking/GPUTRDInterfaces.h)
7171
set(HDRS_CINT_DATATYPES DataTypes/GPUTPCGMMergedTrackHit.h)
72-
set(HDRS_CINT_O2_ADDITIONAL DataTypes/GPUSettings.h DataTypes/GPUSettingsTypes.h Definitions/GPUSettingsList.h DataTypes/GPUDataTypesIO.h DataTypes/GPUDataTypesConfig.h DataTypes/GPUDataTypesQA.h DataTypes/GPUTRDTrack.h DataTypes/GPUTRDRecoParam.h DataTypes/CalibdEdxTrackTopologyPol.h DataTypes/CalibdEdxTrackTopologySpline.h) # Manual dependencies for ROOT dictionary generation
72+
set(HDRS_CINT_O2_ADDITIONAL DataTypes/GPUSettings.h DataTypes/GPUSettingsTypes.h Definitions/GPUSettingsListDisplay.h Definitions/GPUSettingsList.h DataTypes/GPUDataTypesIO.h DataTypes/GPUDataTypesConfig.h DataTypes/GPUDataTypesQA.h DataTypes/GPUTRDTrack.h DataTypes/GPUTRDRecoParam.h DataTypes/CalibdEdxTrackTopologyPol.h DataTypes/CalibdEdxTrackTopologySpline.h) # Manual dependencies for ROOT dictionary generation
7373

7474
set(SRCS_NO_CINT
7575
DataTypes/GPUMemorySizeScalers.cxx
@@ -168,6 +168,7 @@ set(HDRS_INSTALL
168168
TRDTracking/GPUTRDTrackPoint.h
169169
DataTypes/GPUTPCGMPolynomialField.h
170170
DataTypes/GPUSettingsParam.h
171+
Definitions/GPUSettingsListStandalone.h
171172
)
172173

173174
set(SRCS_NO_CINT ${SRCS_NO_CINT} display/GPUDisplayInterface.cxx)

‎GPU/GPUTracking/DataTypes/GPUO2ConfigurableParam.cxx‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ using namespace o2::gpu;
3535
#define AddCustomCPP(...)
3636
#define AddHelp(...)
3737
#define AddShortcut(...)
38+
#include "GPUSettingsListDisplay.h"
3839
#include "GPUSettingsList.h"
3940
#undef BeginNamespace
4041
#undef EndNamespace
@@ -80,6 +81,7 @@ GPUSettingsO2 GPUO2InterfaceConfiguration::ReadConfigurableParam(GPUO2InterfaceC
8081
#define AddCustomCPP(...)
8182
#define AddHelp(...)
8283
#define AddShortcut(...)
84+
#include "GPUSettingsListDisplay.h"
8385
#include "GPUSettingsList.h"
8486
#undef BeginNamespace
8587
#undef EndNamespace

‎GPU/GPUTracking/DataTypes/GPUO2ConfigurableParam.h‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
#include "GPUO2ExternalUser.h"
2626
#include "CommonUtils/ConfigurableParam.h"
2727
#include "CommonUtils/ConfigurableParamHelper.h"
28+
#define GPUSETTINGS_DISPLAY
2829
#include "GPUSettings.h"
2930
#include "GPUDefMacros.h"
3031
#include <vector>
@@ -59,6 +60,7 @@
5960
#define AddShortcut(...)
6061
#define AddOptionRTC(...) AddOption(__VA_ARGS__)
6162
#define AddOptionArrayRTC(...) AddOptionArray(__VA_ARGS__)
63+
#include "GPUSettingsListDisplay.h"
6264
#include "GPUSettingsList.h"
6365
#undef BeginNamespace
6466
#undef EndNamespace

‎GPU/GPUTracking/Definitions/GPUSettingsList.h‎

Lines changed: 0 additions & 203 deletions
Large diffs are not rendered by default.
Lines changed: 150 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,150 @@
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 GPUSettingsListDisplay.h
13+
/// \author David Rohr
14+
15+
// This file contains macros to generate all settings for the GPU Reconstruction.
16+
// Macros are used in the following places:
17+
// Create ConfigurableParam object for workflow.
18+
// Configure standalone benchmark.
19+
// Create plain-C struct for GPU code.
20+
// Create static constexpr with default values for GPU run time compilation
21+
22+
#include "GPUSettingsTypes.h"
23+
24+
#if (!defined(__CLING__) && !defined(G__DICTIONARY)) || defined(BeginSubConfig) // File should not be included without defining the macros, but rootcling will do for dictionary generation
25+
26+
// clang-format off
27+
BeginNamespace(o2::gpu)
28+
29+
// Light settings concerning the event display (can be changed without rebuilding vertices)
30+
BeginSubConfig(GPUSettingsDisplayLight, light, configStandalone.display, "GLL", 'g', "Light OpenGL display settings", display_light)
31+
AddOption(animationMode, int32_t, 0, "", 0, "", min(0), max(6))
32+
AddOption(smoothPoints, bool, true, "", 0, "Apply smoothing to points")
33+
AddOption(smoothLines, bool, false, "", 0, "Apply smoothing to lines")
34+
AddOption(depthBuffer, bool, false, "", 0, "Enable Z-buffer")
35+
AddOption(drawClusters, bool, true, "", 0, "Highlight clusters")
36+
AddOption(drawLinks, bool, false, "", 0, "Highlight links")
37+
AddOption(drawInitLinks, bool, false, "", 0, "Highlight cleaned-up links")
38+
AddOption(drawSeeds, bool, false, "", 0, "Highlight seeds")
39+
AddOption(drawTracklets, bool, false, "", 0, "Highlight tracklets")
40+
AddOption(drawTracks, bool, false, "", 0, "Highlight sector tracks")
41+
AddOption(drawExtrapolatedTracks, bool, false, "", 0, "Highlight global sector tracks prolonged into adjacent sector")
42+
AddOption(drawFinal, bool, false, "", 0, "Highlight final tracks")
43+
AddOption(excludeClusters, int32_t, 0, "", 0, "Exclude clusters from selected draw objects from display, (2 = exclude clusters but still show tracks)")
44+
AddOption(drawSector, int32_t, -1, "", 0, "Show individual sector", min(-1), max(35))
45+
AddOption(drawRelatedSectors, int32_t, 0, "", 0, "Show related sectors (if drawSector != -1)")
46+
AddOption(drawGrid, int32_t, 0, "", 0, "Highlight grid")
47+
AddOption(propagateTracks, int32_t, 0, "", 0, "Propagate final tracks further (inward / outward / show MC tracks)")
48+
AddOption(showCollision, int32_t, -1, "", 0, "Show only individual collision")
49+
AddOption(colorCollisions, int32_t, 0, "", 0, "Distinguish collisions in timeframe by color")
50+
AddOption(colorClusters, int32_t, 1, "", 0, "Color clusters belonging to track objects")
51+
AddOption(pointSize, float, 2.0f, "", 0, "Set point size", min(0.8f), max(20.f))
52+
AddOption(lineWidth, float, 1.4f, "", 0, "Set line width", min(0.4f), max(20.f))
53+
AddOption(drawTPC, bool, true, "", 0, "Enable drawing TPC data")
54+
AddOption(drawTRD, bool, true, "", 0, "Enable drawing TRD data")
55+
AddOption(drawTOF, bool, true, "", 0, "Enable drawing TOF data")
56+
AddOption(drawITS, bool, true, "", 0, "Enable drawing ITS data")
57+
AddOption(drawField, bool, false, "", 0, "Enable drawing magnetic field")
58+
AddOption(bFieldStepSize, float, 5.0f, "", 0, "Set field line step size")
59+
AddOption(bFieldStepCount, int32_t, 100, "", 0, "Set field line step count")
60+
AddOption(bFieldLinesCount, int32_t, 2000, "", 0, "Set field lines count")
61+
AddOption(invertColors, bool, false, "", 0, "Invert colors")
62+
AddHelp("help", 'h')
63+
EndConfig()
64+
65+
// Heavy settings concerning the event display (can be changed only with rebuilding vertices)
66+
BeginSubConfig(GPUSettingsDisplayHeavy, heavy, configStandalone.display, "GLH", 0, "Heavy OpenGL display settings", display_heavy)
67+
AddOption(drawTPCTracks, bool, true, "", 0, "Show tracks with TPC contribution")
68+
AddOption(drawITSTracks, bool, true, "", 0, "Show tracks with ITS contribution")
69+
AddOption(drawTRDTracks, bool, true, "", 0, "Show tracks with TRD contribution")
70+
AddOption(drawTOFTracks, bool, true, "", 0, "Show tracks with TOF contribution")
71+
AddOption(drawTracksAndFilter, bool, false, "", 0, "Use AND filter instead of OR filter for selecting tracks")
72+
AddOption(propagateLoopers, bool, false, "", 0, "Enable propagation of loopers")
73+
AddOption(clustersOnly, bool, false, "", 0, "Visualize clusters only")
74+
AddOption(clustersOnNominalRow, bool, false, "", 0, "Show clusters at nominal x of pad row for early-transformed data")
75+
AddOption(separateExtrapolatedTracks, bool, false, "", 0, "Draw track segments propagated to adjacent sectors separately")
76+
AddOption(splitCETracks, int8_t, -1, "", 0, "Split CE tracks when they cross the central electrode (-1 = for triggered data)")
77+
AddOption(markClusters, int32_t, 0, "", 0, "Mark clusters")
78+
AddOption(markFakeClusters, int32_t, 0, "", 0, "Mark fake clusters")
79+
AddOption(markAdjacentClusters, int32_t, 0, "", 0, "Mark adjacent clusters")
80+
AddOption(hideRejectedClusters, int32_t, 1, "", 0, "Hide rejected clusters")
81+
AddOption(hideRejectedTracks, int32_t, 1, "", 0, "Hide rejected tracks")
82+
AddOption(hideUnmatchedClusters, int32_t, 0, "", 0, "Hide unmatched clusters")
83+
AddOption(trackFilter, int32_t, 0, "", 0, "Apply filter on tracks to be displayed")
84+
AddOption(projectXY, int32_t, 0, "", 0, "Project everything on the XY-plane")
85+
AddOption(xzAdd, float, 0, "", 0, "Separate sectors, increase X coordinate", min(0.f), max(300.f))
86+
AddHelp("help", 'h')
87+
EndConfig()
88+
89+
// Camera, window, and renderer settings for the event display
90+
BeginSubConfig(GPUSettingsDisplayRenderer, renderer, configStandalone.display, "GLR", 'g', "Camera / window / renderer OpenGL display settings", display_camera)
91+
AddOption(camLookOrigin, bool, false, "", 0, "Make the camera look at the origin")
92+
AddOption(camYUp, bool, false, "", 0, "Orient the camera such that the y-axis is always upwards")
93+
AddOption(cameraMode, int32_t, 0, "", 0, "Camera mode")
94+
AddOption(fullScreen, bool, false, "", 0, "Full Screen")
95+
AddOption(maximized, bool, true, "", 0, "Maximized window")
96+
AddOption(drawQualityMSAA, int32_t, 0, "", 0, "MultiSample Anti Aliasing", min(0), max(8))
97+
AddOption(drawQualityDownsampleFSAA, int32_t, 0, "", 0, "Downsampling Anti Aliasing", min(0), max(4))
98+
AddOption(drawQualityVSync, bool, true, "", 0, "Enable Vertical Sync")
99+
AddOption(fpsLimit, int32_t, 1, "", 0, "FPS limit: 0 = none (maximum rate), 1 = display refresh rate (no limit without VSync), 2 = fpsRate")
100+
AddOption(fpsRate, int32_t, 100, "", 0, "Target frame rate (frames per second) for fpsLimit 2, or if the backend cannot limit to the refresh rate", min(1), max(9999))
101+
AddOption(useGLIndirectDraw, bool, true, "", 0, "Use OpenGL indirect draws to reduce number of draw calls")
102+
AddOption(screenshotScaleFactor, int32_t, 1, "", 0, "Resolution scale factor when taking screenshots", min(1), max(4))
103+
AddOption(fov, float, 45.f, "", 0, "Display FOV", min(5.f), max(175.f))
104+
AddHelp("help", 'h')
105+
EndConfig()
106+
107+
// Vulkan Display Settings
108+
BeginSubConfig(GPUSettingsDisplayVulkan, vulkan, configStandalone.display, "GLV", 0, "Vulkan display settings", display_vulkan)
109+
AddOption(nFramesInFlight, uint32_t, 3, "", 0, "Max number of render frames in flight")
110+
AddOption(uniformBuffersInDeviceMemory, bool, 1, "", 0, "Have uniform buffers in host-accessible device memory")
111+
AddOption(forceDevice, int32_t, -1, "", 0, "Force Vulkan device number to use")
112+
AddHelp("help", 'h')
113+
EndConfig()
114+
115+
// Internal display settings (GUI protocol, console, info texts)
116+
BeginSubConfig(GPUSettingsDisplayInternal, internal, configStandalone.display, "GLI", 0, "Internal display settings", display_internal)
117+
AddOption(guiReplyTimeout, uint32_t, 100, "", 0, "Time in ms the Qt GUI waits at most for the display to process its update")
118+
AddOption(guiMaxUpdatesAhead, uint32_t, 3, "", 0, "Number of updates the Qt GUI may send ahead of the last one the display has processed, before it waits for the display")
119+
AddOption(consoleDelay, float, 0.5f, "", 0, "Time in seconds to open / close the console (^ key)")
120+
AddOption(consoleAlpha, float, 0.8f, "", 0, "Opacity of the console background")
121+
AddOption(consoleVertical, float, 0.5f, "", 0, "Fraction of the window height covered by the fully opened console")
122+
AddOption(consoleHistorySize, uint32_t, 1000000, "", 0, "Number of console lines kept, the history is shortened to this when it reaches twice the size")
123+
AddOption(setInfoTime, float, 5.0f, "", 0, "Time in seconds an info message (SetInfo) is shown fully opaque")
124+
AddOption(setInfoTransition, float, 1.0f, "", 0, "Time in seconds an info message fades out after setInfoTime")
125+
AddHelp("help", 'h')
126+
EndConfig()
127+
128+
// Settings concerning the event display (fixed settings, cannot be changed)
129+
BeginSubConfig(GPUSettingsDisplay, display, configStandalone, "GL", 'g', "OpenGL display settings", display)
130+
AddOption(showTPCTracksFromO2Format, bool, false, "", 0, "Use TPC tracks in O2 output format instead of GPU format")
131+
AddOption(font, std::string, "monospace", "", 0, "Font (search patter used for Fontconfig)")
132+
AddOption(fontSize, int32_t, 14, "", 0, "Font size")
133+
AddOption(smoothFont, int32_t, -1, "", 0, "Smoth font when rendering (-1 for auto-select based on size")
134+
AddOption(noFreetype, bool, false, "", 0, "Do not use Freetype for font rendering (can only draw text if supported by frontend)")
135+
AddOption(displayRenderer, std::string, "auto", "renderer", 0, "Renderer for event display: opengl | vulkan | auto")
136+
AddOption(displayFrontend, std::string, "auto", "displayFrontend", 0, "Frontend to use for event display: auto | win32 | x11 | glut | glfw | wayland")
137+
AddOptionVec(filterMacros, std::string, "", 0, "ROOT macros used as track filter")
138+
AddOption(listFrontendOptionHandling, bool, false, "", 0, "List all assigned keys in frontend, Configurable settings in Qt GUI, and missing configuration options")
139+
AddOption(runScript, std::string, "", "", 0, "Console script file, run before the first frame of the display")
140+
AddSubConfig(GPUSettingsDisplayLight, light)
141+
AddSubConfig(GPUSettingsDisplayHeavy, heavy)
142+
AddSubConfig(GPUSettingsDisplayRenderer, renderer)
143+
AddSubConfig(GPUSettingsDisplayVulkan, vulkan)
144+
AddSubConfig(GPUSettingsDisplayInternal, internal)
145+
AddHelp("help", 'h')
146+
EndConfig()
147+
148+
EndNamespace() // o2::gpu
149+
150+
#endif // (!defined(__CLING__) && !defined(G__DICTIONARY)) || defined(BeginSubConfig)

0 commit comments

Comments
 (0)