Skip to content

Commit e3b82a8

Browse files
committed
GPU: Fix typo in variable name, fix comments, fix debug messages
1 parent 7872ee5 commit e3b82a8

File tree

5 files changed

+11
-11
lines changed

5 files changed

+11
-11
lines changed

GPU/GPUTracking/Base/GPUReconstructionCPU.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ inline void GPUReconstructionCPUBackend::runKernelBackendInternal(const krnlSetu
6868
int32_t nThreads = getNKernelHostThreads(false);
6969
if (nThreads > 1) {
7070
if (mProcessingSettings.debugLevel >= 5) {
71-
printf("Running %d Threads\n", nThreads);
71+
printf("Running %d Threads\n", mThreading->activeThreads->max_concurrency());
7272
}
7373
tbb::this_task_arena::isolate([&] {
7474
mThreading->activeThreads->execute([&] {
@@ -91,10 +91,10 @@ inline void GPUReconstructionCPUBackend::runKernelBackendInternal(const krnlSetu
9191
template <>
9292
inline void GPUReconstructionCPUBackend::runKernelBackendInternal<GPUMemClean16, 0>(const krnlSetupTime& _xyz, void* const& ptr, uint64_t const& size)
9393
{
94-
int32_t nnThreads = std::max<int32_t>(1, std::min<int32_t>(size / (16 * 1024 * 1024), getNKernelHostThreads(true)));
95-
if (nnThreads > 1) {
96-
tbb::parallel_for(0, nnThreads, [&](int iThread) {
97-
size_t threadSize = size / nnThreads;
94+
int32_t nThreads = std::max<int32_t>(1, std::min<int32_t>(size / (16 * 1024 * 1024), getNKernelHostThreads(true)));
95+
if (nThreads > 1) {
96+
tbb::parallel_for(0, nThreads, [&](int iThread) {
97+
size_t threadSize = size / nThreads;
9898
if (threadSize % 4096) {
9999
threadSize += 4096 - threadSize % 4096;
100100
}

GPU/GPUTracking/Base/cuda/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77,8 +77,8 @@ add_custom_command(
7777
create_binary_resource(${GPU_RTC_BIN}.src ${GPU_RTC_BIN}.src.o)
7878

7979
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done
80-
COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done || bash -c "echo ERROR: CUDA RTC sources contain standard headers 1>&2 && exit 1"
81-
COMMENT "Checking CUDA RTC File ${GPU_RTC_BIN}.src"
80+
COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done || bash -c "echo ERROR: CUDA RTC sources contain system headers 1>&2 && exit 1"
81+
COMMENT "Checking CUDA RTC File ${GPU_RTC_BIN}.src for system headers"
8282
DEPENDS ${GPU_RTC_BIN}.src VERBATIM)
8383
add_custom_target(${MODULE}_CUDA_SRC_CHK ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_CUDA_SRC_CHK.done)
8484

GPU/GPUTracking/Base/hip/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ add_custom_command(
115115
create_binary_resource(${GPU_RTC_BIN}.src ${GPU_RTC_BIN}.src.o)
116116

117117
add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done
118-
COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done || bash -c "echo ERROR: HIP RTC sources contain standard headers 1>&2 && exit 1"
119-
COMMENT "Checking HIP RTC File ${GPU_RTC_BIN}.src"
118+
COMMAND ! grep "# [0-9]* \"\\(/usr/\\|.*GCC-Toolchain\\)" ${GPU_RTC_BIN}.src > ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done || bash -c "echo ERROR: HIP RTC sources contain system headers 1>&2 && exit 1"
119+
COMMENT "Checking HIP RTC File ${GPU_RTC_BIN}.src for system headers"
120120
DEPENDS ${GPU_RTC_BIN}.src VERBATIM)
121121
add_custom_target(${MODULE}_HIP_SRC_CHK ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/${MODULE}_HIP_SRC_CHK.done)
122122

GPU/GPUTracking/Global/GPUChainTracking.cxx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@ bool GPUChainTracking::ValidateSettings()
267267
return false;
268268
}
269269
if ((GetRecoStepsGPU() & RecoStep::TPCClusterFinding) && std::max(GetProcessingSettings().nTPCClustererLanes + 1, GetProcessingSettings().nTPCClustererLanes * 2) + (GetProcessingSettings().doublePipeline ? 1 : 0) > (int32_t)mRec->NStreams()) {
270-
GPUError("NStreams (%d) must be > nTPCClustererLanes (%d)", mRec->NStreams(), (int32_t)GetProcessingSettings().nTPCClustererLanes);
270+
GPUError("NStreams of %d insufficient for %d nTPCClustererLanes", mRec->NStreams(), (int32_t)GetProcessingSettings().nTPCClustererLanes);
271271
return false;
272272
}
273273
if (GetProcessingSettings().noGPUMemoryRegistration && GetProcessingSettings().tpcCompressionGatherMode != 3) {

GPU/GPUTracking/cmake/kernel_helpers.cmake

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ function(o2_gpu_add_kernel kernel_name kernel_files)
7676
set_property(TARGET O2_GPU_KERNELS APPEND PROPERTY O2_GPU_KERNEL_NAMES "${kernel_name}")
7777
set_property(TARGET O2_GPU_KERNELS APPEND PROPERTY O2_GPU_KERNEL_INCLUDES "${TMP_KERNEL_CLASS_FILE}")
7878
set_property(TARGET O2_GPU_KERNELS APPEND PROPERTY O2_GPU_KERNEL_FILES "${TMP_KERNEL_CLASS_FILE}.cxx")
79-
# add_custom_command OUTPUT option does not support target-dependend generator expressions, thus this workaround
8079

8180
set(O2_GPU_KERNEL_TEMPLATE_FILES "GPUConstantMem.h")
8281
if (GPUCA_BUILD_DEBUG)
@@ -102,6 +101,7 @@ function(o2_gpu_add_kernel kernel_name kernel_files)
102101
list(TRANSFORM O2_GPU_KERNEL_TEMPLATE_FILES PREPEND "#include \"")
103102
list(JOIN O2_GPU_KERNEL_TEMPLATE_FILES "\n" O2_GPU_KERNEL_TEMPLATE_FILES)
104103

104+
# add_custom_command OUTPUT option does not support target-dependend generator expressions, thus this workaround to create CUDA and HIP files
105105
string(REPLACE ", " "_" TMP_FILENAME "${kernel_name}")
106106
if(CUDA_ENABLED)
107107
set(TMP_FILENAMEA "${O2_GPU_KERNEL_WRAPPER_FOLDER}/krnl_${TMP_FILENAME}.cu")

0 commit comments

Comments
 (0)