From ce4914241364372b13dafa8d1e81984704953807 Mon Sep 17 00:00:00 2001 From: David Rohr Date: Fri, 28 Mar 2025 14:56:47 +0100 Subject: [PATCH 1/2] GPU RTC: Add tool to dump GPU RTC launch bound parameter object --- GPU/Common/CMakeLists.txt | 5 +++ GPU/GPUTracking/CMakeLists.txt | 9 ++++- .../Standalone/tools/dumpGPUDefParam.C | 37 +++++++++++++++++++ 3 files changed, 49 insertions(+), 2 deletions(-) create mode 100644 GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C diff --git a/GPU/Common/CMakeLists.txt b/GPU/Common/CMakeLists.txt index efac4fc436758..6951c3b2339b8 100644 --- a/GPU/Common/CMakeLists.txt +++ b/GPU/Common/CMakeLists.txt @@ -64,3 +64,8 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2") endif() install(FILES ${HDRS_INSTALL} DESTINATION include/GPU) endif() + +if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") + install(FILES ${HDRS_INSTALL} + DESTINATION include) +endif() diff --git a/GPU/GPUTracking/CMakeLists.txt b/GPU/GPUTracking/CMakeLists.txt index 33715909e810c..fe2fefe2412c0 100644 --- a/GPU/GPUTracking/CMakeLists.txt +++ b/GPU/GPUTracking/CMakeLists.txt @@ -258,7 +258,7 @@ file(GENERATE if(NOT ALIGPU_BUILD_TYPE STREQUAL "O2") include_directories(${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly) endif() -set(HDRS_INSTALL ${HDRS_INSTALL} ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUReconstructionKernelList.h ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUDefParameters.h) +set(HDRS_INSTALL ${HDRS_INSTALL} ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUReconstructionKernelList.h ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUDefParameters.h ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUDefParametersLoad.inc) include(kernels.cmake) # Optional sources depending on optional dependencies @@ -376,13 +376,18 @@ if(ALIGPU_BUILD_TYPE STREQUAL "Standalone") if(GPUCA_CONFIG_ROOT) ROOT_GENERATE_DICTIONARY(G__${targetName} ${HDRS_CINT_O2} ${HDRS_CINT_DATATYPES} ${HDRS_CINT_O2_ADDITIONAL} GPUTrackingLinkDef_Standalone.h MODULE ${targetName}) - INSTALL(FILES + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/lib${targetName}_rdict.pcm ${CMAKE_CURRENT_BINARY_DIR}/lib${targetName}.rootmap DESTINATION .) else() target_compile_definitions(${targetName} PRIVATE GPUCA_NO_ROOT) endif() + install(FILES ${HDRS_SRCS} ${HDRS_CINT_O2} ${HDRS_CINT_DATATYPES} ${HDRS_INSTALL} + DESTINATION include) + install(DIRECTORY utils + DESTINATION include + FILES_MATCHING PATTERN *.h) endif() # GPUReconstructionLibrary needs to know which GPU backends are enabled for proper error messages diff --git a/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C b/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C new file mode 100644 index 0000000000000..44b2fed68ba57 --- /dev/null +++ b/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C @@ -0,0 +1,37 @@ +// Copyright 2019-2020 CERN and copyright holders of ALICE O2. +// See https://alice-o2.web.cern.ch/copyright for details of the copyright holders. +// All rights not expressly granted are reserved. +// +// This software is distributed under the terms of the GNU General Public +// License v3 (GPL Version 3), copied verbatim in the file "COPYING". +// +// 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 dumpGPUDefParam.C +/// \author David Rohr + +// Run e.g. as: +// ROOT_INCLUDE_PATH="`pwd`/include" root -l -q -b src/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C'()' + +// Logic for testing to load the default parameters +/*#define GPUCA_GPUCODE +#define GPUCA_GPUTYPE_AMPERE +#define GPUCA_DEF_PARAMETERS_LOAD_DEFAULTS +#define GPUCA_MAXN 40 +#define GPUCA_ROW_COUNT 152 +#define GPUCA_TPC_COMP_CHUNK_SIZE 1024 +#include "GPUDefParametersDefault.h"*/ + +// Load file that sets GPUDefParameters +#include "testParam.h" + +#include "GPUDefParametersLoad.inc" +void dumpGPUDefParam() { + auto param = o2::gpu::internal::GPUDefParametersLoad(); + printf("Loaded params:\n%s", o2::gpu::internal::GPUDefParametersExport(param, false).c_str()); + FILE* fp = fopen("parameters.out", "w+b"); + fwrite(¶m, 1, sizeof(param), fp); + fclose(fp); +} From be6f401d66d5ebeddf841a891b0766af4c2019a4 Mon Sep 17 00:00:00 2001 From: ALICE Action Bot Date: Fri, 28 Mar 2025 18:55:19 +0000 Subject: [PATCH 2/2] Please consider the following formatting changes --- GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C b/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C index 44b2fed68ba57..4a2575c40d79a 100644 --- a/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C +++ b/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C @@ -28,10 +28,11 @@ #include "testParam.h" #include "GPUDefParametersLoad.inc" -void dumpGPUDefParam() { - auto param = o2::gpu::internal::GPUDefParametersLoad(); - printf("Loaded params:\n%s", o2::gpu::internal::GPUDefParametersExport(param, false).c_str()); - FILE* fp = fopen("parameters.out", "w+b"); - fwrite(¶m, 1, sizeof(param), fp); - fclose(fp); +void dumpGPUDefParam() +{ + auto param = o2::gpu::internal::GPUDefParametersLoad(); + printf("Loaded params:\n%s", o2::gpu::internal::GPUDefParametersExport(param, false).c_str()); + FILE* fp = fopen("parameters.out", "w+b"); + fwrite(¶m, 1, sizeof(param), fp); + fclose(fp); }