Skip to content

Commit ca4e47c

Browse files
committed
GPU RTC: Add tool to dump GPU RTC launch bound parameter object
1 parent 483990f commit ca4e47c

File tree

3 files changed

+50
-2
lines changed

3 files changed

+50
-2
lines changed

GPU/Common/CMakeLists.txt

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,8 @@ if(ALIGPU_BUILD_TYPE STREQUAL "O2")
6464
endif()
6565
install(FILES ${HDRS_INSTALL} DESTINATION include/GPU)
6666
endif()
67+
68+
if(ALIGPU_BUILD_TYPE STREQUAL "Standalone")
69+
install(FILES ${HDRS_INSTALL}
70+
DESTINATION include)
71+
endif()

GPU/GPUTracking/CMakeLists.txt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ file(GENERATE
258258
if(NOT ALIGPU_BUILD_TYPE STREQUAL "O2")
259259
include_directories(${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly)
260260
endif()
261-
set(HDRS_INSTALL ${HDRS_INSTALL} ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUReconstructionKernelList.h ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly/GPUDefParameters.h)
261+
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)
262262
include(kernels.cmake)
263263

264264
# Optional sources depending on optional dependencies
@@ -376,13 +376,18 @@ if(ALIGPU_BUILD_TYPE STREQUAL "Standalone")
376376

377377
if(GPUCA_CONFIG_ROOT)
378378
ROOT_GENERATE_DICTIONARY(G__${targetName} ${HDRS_CINT_O2} ${HDRS_CINT_DATATYPES} ${HDRS_CINT_O2_ADDITIONAL} GPUTrackingLinkDef_Standalone.h MODULE ${targetName})
379-
INSTALL(FILES
379+
install(FILES
380380
${CMAKE_CURRENT_BINARY_DIR}/lib${targetName}_rdict.pcm
381381
${CMAKE_CURRENT_BINARY_DIR}/lib${targetName}.rootmap
382382
DESTINATION .)
383383
else()
384384
target_compile_definitions(${targetName} PRIVATE GPUCA_NO_ROOT)
385385
endif()
386+
install(FILES ${HDRS_SRCS} ${HDRS_CINT_O2} ${HDRS_CINT_DATATYPES} ${HDRS_INSTALL}
387+
DESTINATION include)
388+
install(DIRECTORY utils
389+
DESTINATION include
390+
FILES_MATCHING PATTERN *.h)
386391
endif()
387392

388393
# GPUReconstructionLibrary needs to know which GPU backends are enabled for proper error messages
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
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 dumpGPUDefParam.C
13+
/// \author David Rohr
14+
15+
// Run e.g. as:
16+
// ROOT_INCLUDE_PATH="`pwd`/include" root -l -q -b src/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C'()'
17+
18+
// Logic for testing to load the default parameters
19+
/*#define GPUCA_GPUCODE
20+
#define GPUCA_GPUTYPE_AMPERE
21+
#define GPUCA_DEF_PARAMETERS_LOAD_DEFAULTS
22+
#define GPUCA_MAXN 40
23+
#define GPUCA_ROW_COUNT 152
24+
#define GPUCA_TPC_COMP_CHUNK_SIZE 1024
25+
#include "GPUDefParametersDefault.h"*/
26+
27+
// Load file that sets GPUDefParameters
28+
#include "testParam.h"
29+
30+
#include "GPUDefParametersLoad.inc"
31+
void dumpGPUDefParam()
32+
{
33+
auto param = o2::gpu::internal::GPUDefParametersLoad();
34+
printf("Loaded params:\n%s", o2::gpu::internal::GPUDefParametersExport(param, false).c_str());
35+
FILE* fp = fopen("parameters.out", "w+b");
36+
fwrite(&param, 1, sizeof(param), fp);
37+
fclose(fp);
38+
}

0 commit comments

Comments
 (0)