Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Base/GPUConstantMem.h
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ GPUconstant() GPUConstantMemCopyable gGPUConstantMemBuffer;
#endif

// Must be placed here, to avoid circular header dependency
GPUdi() GPUconstantref() const GPUConstantMem* GPUProcessor::GetConstantMem() const
GPUdi() GPUCA_RTC_CONSTEXPR GPUconstantref() const GPUConstantMem* GPUProcessor::GetConstantMem() const
{
#if defined(GPUCA_GPUCODE_DEVICE) && defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM)
return &GPUCA_CONSMEM;
Expand All @@ -108,7 +108,7 @@ GPUdi() GPUconstantref() const GPUConstantMem* GPUProcessor::GetConstantMem() co
#endif
}

GPUdi() GPUconstantref() const GPUParam& GPUProcessor::Param() const
GPUdi() GPUCA_RTC_CONSTEXPR GPUconstantref() const GPUParam& GPUProcessor::Param() const
{
return GetConstantMem()->param;
}
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Base/GPUProcessor.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ class GPUProcessor
GPUProcessor& operator=(const GPUProcessor&) = delete;
#endif

GPUd() GPUconstantref() const GPUConstantMem* GetConstantMem() const; // Body in GPUConstantMem.h to avoid circular headers
GPUd() GPUconstantref() const GPUParam& Param() const; // ...
GPUd() GPUCA_RTC_CONSTEXPR GPUconstantref() const GPUConstantMem* GetConstantMem() const; // Body in GPUConstantMem.h to avoid circular headers; constexpr in RTC, so that RTC-constexpr options can be read via Param()
GPUd() GPUCA_RTC_CONSTEXPR GPUconstantref() const GPUParam& Param() const; // ...
GPUd() void raiseError(uint32_t code, uint32_t param1 = 0, uint32_t param2 = 0, uint32_t param3 = 0) const;
GPUd() bool IsDeviceProcessor() const { return mGPUProcessorType == PROCESSOR_TYPE_DEVICE; }
const GPUReconstruction& GetRec() const { return *mRec; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,5 +23,8 @@
#include <atomic>
#include <cassert>
#include <climits>
#if __cplusplus >= 202302L && __has_include(<stdfloat>)
#include <stdfloat>
#endif

#endif // O2_GPU_GPURECONSTRUCTIONCPUDEVICEINCLUDESSYSTEM_H
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@

#include <hip/hip_runtime.h>
#include <hip/hip_ext.h>
#if __cplusplus >= 202302L
#include <mdspan> // BUG: hipcub uses std::extents with C++23 without including <mdspan>
#endif
#include <hipcub/hipcub.hpp>
#include <thrust/sort.h>
#include <thrust/execution_policy.h>
Expand Down
2 changes: 1 addition & 1 deletion GPU/GPUTracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -497,7 +497,7 @@ endif()
if(METAL_ENABLED)
add_subdirectory(Base/metal)
elseif(CUDA_ENABLED OR OPENCL_ENABLED OR HIP_ENABLED)
make_directory(${CMAKE_CURRENT_BINARY_DIR}/genGPUArch)
file(MAKE_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR}/genGPUArch)
set(GPU_CONST_PARAM_FILES)
foreach(GPU_ARCH ${GPU_CONST_PARAM_ARCHITECTUES})
set(PARAMFILE ${CMAKE_CURRENT_BINARY_DIR}/genGPUArch/gpu_const_param_${GPU_ARCH}.par)
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Definitions/GPUGetConstexpr.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

// This is a temporary workaround required for clang (with c++20), until we can go to C++23 with P2280R4, which allows getting constexpr static values from references

#if defined(GPUCA_GPUCODE_GENRTC) && __cplusplus >= 202002L && __cplusplus < 202302L
#if defined(GPUCA_GPUCODE_GENRTC) && (!defined(GPUCA_HAS_GLOBAL_SYMBOL_CONSTANT_MEM) || __cplusplus < 202302L || defined(__NVCC__))

namespace o2::gpu::internal
{
Expand Down Expand Up @@ -60,7 +60,7 @@ GPUdi() constexpr auto getConstexpr(const auto v, const auto w)

} // namespace o2::gpu::internal

#else // GPUCA_GPUCODE_GENRTC
#else

#define GPUCA_GET_CONSTEXPR(obj, val) (obj).val

Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Merger/GPUTPCGMTrackParam.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ GPUd() bool GPUTPCGMTrackParam::Fit(GPUTPCGMMerger& GPUrestrict() merger, GPUTPC

uint8_t dEdxSubThresholdRow = 255;
if (rowGap) {
const bool dodEdx = param.dodEdxEnabled && param.rec.tpc.adddEdxSubThresholdClusters && finalFit && CAMath::Abs(cluster.row - lastUpdateRow) == 2 && cluster.sector == lastSector && currentClusterStatus == 0;
const bool dodEdx = param.dodEdxEnabled && param.rec.tpc.adddEdxSubThresholdClusters != 0 && finalFit && CAMath::Abs(cluster.row - lastUpdateRow) == 2 && cluster.sector == lastSector && currentClusterStatus == 0;
const bool crossCE = lastSector != 255 && ((cluster.sector >= GPUTPCGeometry::NSECTORS / 2) != (lastSector >= GPUTPCGeometry::NSECTORS / 2));
const bool ceOverlap = crossCE && ((cluster.row > lastPropagateRow) != ((clusters[0].row < clusters[maxN - 1].row) ^ (iWay & 1))); // Row gap goes backwards at the CE crossing, these rows were already searched on both sides
const bool doAttach = (adjacentInRebuild ? (iWay == wayRebuildStart + 1 && !ceOverlap) : (allowChangeClusters && !param.rec.tpc.rebuildTrackInFit)) && !(param.rec.tpc.disableMarkAdjacent & 2);
Expand Down Expand Up @@ -509,7 +509,7 @@ GPUdii() int32_t GPUTPCGMTrackParam::FitHit(GPUTPCGMMerger& GPUrestrict() merger

bool rejectChi2 = !retryAttempt && (clusterState & GPUTPCGMMergedTrackHit::flagReject);
if (!retryAttempt) {
if (finalFit && (param.rec.tpc.mergerInterpolateErrors || param.rec.tpc.rebuildTrackInFit)) {
if (finalFit && (param.rec.tpc.mergerInterpolateErrors != 0 || param.rec.tpc.rebuildTrackInFit != 0)) {
if (param.rec.tpc.mergerInterpolateRejectAlsoOnCurrentPosition && GetNDF() > (int32_t)param.rec.tpc.mergerNonInterpolateRejectMinNDF) {
rejectChi2 = true;
}
Expand Down
9 changes: 7 additions & 2 deletions dependencies/FindO2GPU.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
# or submit itself to any jurisdiction.

# NOTE!!!! - Whenever this file is changed, move it over to alidist/resources
# FindO2GPU.cmake Version 26
# FindO2GPU.cmake Version 27

set(CUDA_COMPUTETARGET_DEFAULT_FULL 80-real;86-real;89-real;120-real;75-virtual)
set(HIP_AMDGPUTARGET_DEFAULT_FULL gfx906;gfx908)
Expand Down Expand Up @@ -392,6 +392,11 @@ if(ENABLE_HIP)
elseif(DEFINED ENV{GCC_TOOLCHAIN_ROOT})
set(CMAKE_HIP_HOST_COMPILER "$ENV{GCC_TOOLCHAIN_ROOT}/bin/gcc")
endif()
if(CMAKE_HIP_HOST_COMPILER) # Clang ignores CMAKE_HIP_HOST_COMPILER for AMD and would pick the system GCC / libstdc++
execute_process(COMMAND ${CMAKE_HIP_HOST_COMPILER} -print-libgcc-file-name OUTPUT_VARIABLE GPUCA_HIP_GCC_INSTALL_DIR OUTPUT_STRIP_TRAILING_WHITESPACE COMMAND_ERROR_IS_FATAL ANY)
get_filename_component(GPUCA_HIP_GCC_INSTALL_DIR "${GPUCA_HIP_GCC_INSTALL_DIR}" DIRECTORY)
string(APPEND CMAKE_HIP_FLAGS " --gcc-install-dir=${GPUCA_HIP_GCC_INSTALL_DIR}")
endif()
enable_language(HIP)
endif()
elseif(NOT ENABLE_HIP STREQUAL "AUTO")
Expand All @@ -411,7 +416,7 @@ if(ENABLE_HIP)
set_target_properties(roc::rocthrust PROPERTIES IMPORTED_GLOBAL TRUE)
set(CMAKE_HIP_FLAGS "${O2_GPU_CMAKE_CXX_FLAGS_NOSTD} ${CMAKE_HIP_FLAGS} ${GPUCA_HIP_DENORMALS_FLAGS}")
set(CMAKE_HIP_FLAGS_${CMAKE_BUILD_TYPE_UPPER} "${CMAKE_CXX_FLAGS_${CMAKE_BUILD_TYPE_UPPER}} ${CMAKE_HIP_FLAGS_${CMAKE_BUILD_TYPE_UPPER}}")
string(APPEND CMAKE_HIP_FLAGS " -fgpu-defer-diag -mllvm -amdgpu-enable-lower-module-lds=false -mllvm -amdgpu-function-calls=true -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -Wno-invalid-constexpr -Wno-ignored-optimization-argument -Wno-unused-private-field -Wno-pass-failed ")
string(APPEND CMAKE_HIP_FLAGS " -fgpu-defer-diag -mllvm -amdgpu-function-calls=true -Wno-invalid-command-line-argument -Wno-unused-command-line-argument -Wno-invalid-constexpr -Wno-ignored-optimization-argument -Wno-unused-private-field -Wno-pass-failed ")
if(GPUCA_KERNEL_RESOURCE_USAGE_VERBOSE)
string(APPEND CMAKE_HIP_FLAGS " -Rpass-analysis=kernel-resource-usage")
endif()
Expand Down