|
12 | 12 | /// \file dumpGPUDefParam.C |
13 | 13 | /// \author David Rohr |
14 | 14 |
|
15 | | -// Run e.g. as: |
16 | | -// ROOT_INCLUDE_PATH="`pwd`/include/GPU" root -l -q -b src/GPU/GPUTracking/Standalone/tools/dumpGPUDefParam.C'()' |
| 15 | +// Run e.g. as (replacing [FILE] and [OUTPUT]: |
| 16 | +// echo -e '#define PARAMETER_FILE "[FILE]]"\ngInterpreter->AddIncludePath("'`pwd`'/include/GPU");\n.x share/GPU/tools/dumpGPUDefParam.C("[OUTPUT]")\n.q\n' | root -l -b |
| 17 | +// To dump the defaults for AMPERE architecture, run |
| 18 | +// echo -e '#define GPUCA_GPUTYPE_AMPERE\n#define PARAMETER_FILE "GPUDefParametersDefaults.h"\ngInterpreter->AddIncludePath("'`pwd`'/include/GPU");\n.x share/GPU/tools/dumpGPUDefParam.C("default_AMPERE.par")\n.q\n' | root -l -b |
17 | 19 |
|
18 | | -// Logic for testing to load the default parameters |
19 | | -/* #define GPUCA_GPUCODE |
20 | | -#define GPUCA_GPUTYPE_AMPERE |
21 | | -#define GPUCA_MAXN 40 |
22 | | -#define GPUCA_ROW_COUNT 152 |
23 | | -#define GPUCA_TPC_COMP_CHUNK_SIZE 1024 |
24 | | -#include "GPUDefParametersConstants.h" |
25 | | -#include "GPUDefParametersDefaults.h" */ |
| 20 | +#ifndef PARAMETER_FILE |
| 21 | +#error Must provide the PARAMETER_FILE as preprocessor define, e.g. -DHEADER_TO_INCLUDE='"GPUDefParametersDefaults.h"' |
| 22 | +#endif |
26 | 23 |
|
27 | | -// Alternatively, logic to load file that sets GPUDefParameters |
28 | | -#include "testParam.h" |
| 24 | +#define GPUCA_GPUCODE |
| 25 | +#include PARAMETER_FILE |
29 | 26 |
|
30 | 27 | #include "GPUDefParametersLoad.inc" |
31 | | -void dumpGPUDefParam() |
| 28 | +void dumpGPUDefParam(const char* outputfile = "parameters.out") |
32 | 29 | { |
33 | 30 | 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"); |
| 31 | + printf("Loaded params:\n%s\nWriting them to %s\n", o2::gpu::internal::GPUDefParametersExport(param, false).c_str(), outputfile); |
| 32 | + FILE* fp = fopen(outputfile, "w+b"); |
36 | 33 | fwrite(¶m, 1, sizeof(param), fp); |
37 | 34 | fclose(fp); |
38 | 35 | } |
0 commit comments