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
2 changes: 1 addition & 1 deletion GPU/Common/GPUCommonMath.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ class GPUCommonMath
GPUhdi() static float Remainderf(float x, float y);
GPUd() constexpr static bool Finite(float x);
GPUd() constexpr static bool IsNaN(float x);
#ifndef __FAST_MATH__
#if !defined(__FAST_MATH__) && !defined(GPUCA_GPUCODE_GENRTC)
GPUd() constexpr static float QuietNaN() { return GPUCA_CHOICE(std::numeric_limits<float>::quiet_NaN(), __builtin_nanf(""), NAN); }
#endif
GPUd() constexpr static uint32_t Clz(uint32_t val);
Expand Down
4 changes: 4 additions & 0 deletions GPU/GPUTracking/Base/GPUReconstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ int32_t GPUReconstruction::InitPhaseBeforeDevice()
}
GPUConfigDump::dumpConfig(&param().rec, mProcessingSettings.get(), chTrk ? chTrk->GetQAConfig() : nullptr, chTrk ? chTrk->GetEventDisplayConfig() : nullptr, mDeviceBackendSettings.get(), &mRecoSteps);
}
if (GPUConfigDump::checkConfig(GetProcessingSettings(), *mDeviceBackendSettings)) {
GPUError("Invalid settings");
return 1;
}
mRecoSteps.stepsGPUMask &= mRecoSteps.steps;
mRecoSteps.stepsGPUMask &= AvailableGPURecoSteps();
if (!IsGPU()) {
Expand Down
6 changes: 3 additions & 3 deletions GPU/GPUTracking/Base/cuda/GPUReconstructionCUDAGenRTC.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -45,10 +45,10 @@ int32_t GPUReconstructionCUDA::genRTC(std::string& filename, uint32_t& nCompile)

rtchelpers::loadLaunchBounds(proc, *mParDevice);
if constexpr (std::string_view("CUDA") == "HIP") { // Check if we are RTC-compiling for HIP
if (proc.hipOverrideAMDEUSperCU > 0) {
mParDevice->par_AMD_EUS_PER_CU = proc.hipOverrideAMDEUSperCU;
if (proc.backend.overrideEUSperCU > 0) {
mParDevice->par_AMD_EUS_PER_CU = proc.backend.overrideEUSperCU;
} else if (mParDevice->par_AMD_EUS_PER_CU <= 0) {
GPUFatal("AMD_EUS_PER_CU not set in the parameters provided for the AMD GPU, you can override this via --PROChipOverrideAMDEUSperCU [n]");
GPUFatal("AMD_EUS_PER_CU not set in the parameters provided for the AMD GPU, you can override this via --BACKENDbackendOverrideEUSperCU [n]");
}
}
for (uint32_t i = 0; i < GetNKernels(); i++) {
Expand Down
24 changes: 12 additions & 12 deletions GPU/GPUTracking/Base/opencl/GPUReconstructionOCL.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -126,17 +126,17 @@ int32_t GPUReconstructionOCL::InitDevice_Runtime()

cl_uint deviceCount, bestDevice = (cl_uint)-1, bestPlatform = (cl_uint)-1;
for (uint32_t iPlatform = 0; iPlatform < num_platforms; iPlatform++) {
if (GetProcessingSettings().oclPlatformNum >= 0) {
if (GetProcessingSettings().oclPlatformNum >= (int32_t)num_platforms) {
if (GetProcessingSettings().backend.platformNum >= 0) {
if (GetProcessingSettings().backend.platformNum >= (int32_t)num_platforms) {
GPUErrorReturn("Invalid platform specified");
}
iPlatform = GetProcessingSettings().oclPlatformNum;
iPlatform = GetProcessingSettings().backend.platformNum;
}
std::string platformUsageInfo;
bool platformCompatible = false;
queryPlatform(platforms[iPlatform]);
if (clGetDeviceIDs(platforms[iPlatform], CL_DEVICE_TYPE_ALL, 0, nullptr, &deviceCount) != CL_SUCCESS) {
if (GetProcessingSettings().oclPlatformNum >= 0) {
if (GetProcessingSettings().backend.platformNum >= 0) {
GPUErrorReturn("No device in requested platform or error obtaining device count");
}
platformUsageInfo += " - no devices";
Expand All @@ -147,16 +147,16 @@ int32_t GPUReconstructionOCL::InitDevice_Runtime()
}
}

if (GetProcessingSettings().oclPlatformNum >= 0 || GetProcessingSettings().debugLevel >= 2) {
GPUInfo("%s Platform %d: (%s %s) %s %s (Compatible: %s)%s", GetProcessingSettings().oclPlatformNum >= 0 ? "Enforced" : "Available", iPlatform, platform_profile.c_str(), platform_version.c_str(), platform_vendor.c_str(), platform_name.c_str(), platformCompatible ? "yes" : "no", GetProcessingSettings().debugLevel >= 2 ? platformUsageInfo.c_str() : "");
if (GetProcessingSettings().backend.platformNum >= 0 || GetProcessingSettings().debugLevel >= 2) {
GPUInfo("%s Platform %d: (%s %s) %s %s (Compatible: %s)%s", GetProcessingSettings().backend.platformNum >= 0 ? "Enforced" : "Available", iPlatform, platform_profile.c_str(), platform_version.c_str(), platform_vendor.c_str(), platform_name.c_str(), platformCompatible ? "yes" : "no", GetProcessingSettings().debugLevel >= 2 ? platformUsageInfo.c_str() : "");
}

if (platformCompatible || GetProcessingSettings().oclPlatformNum >= 0 || (GetProcessingSettings().oclPlatformNum == -2 && deviceCount)) {
if (platformCompatible || GetProcessingSettings().backend.platformNum >= 0 || (GetProcessingSettings().backend.platformNum == -2 && deviceCount)) {
if (deviceCount > devices.size()) {
devices.resize(deviceCount);
}
if (clGetDeviceIDs(platforms[iPlatform], CL_DEVICE_TYPE_ALL, deviceCount, devices.data(), nullptr) != CL_SUCCESS) {
if (GetProcessingSettings().oclPlatformNum >= 0) {
if (GetProcessingSettings().backend.platformNum >= 0) {
GPUErrorReturn("Error getting OpenCL devices");
}
continue;
Expand Down Expand Up @@ -184,7 +184,7 @@ int32_t GPUReconstructionOCL::InitDevice_Runtime()
deviceOK = false;
deviceFailure += " - No Little Endian Mode";
}
if (!GetProcessingSettings().oclCompileFromSources) {
if (!GetProcessingSettings().backend.compileFromSources) {
size_t pos = 0;
while ((pos = device_il_version.find("SPIR-V", pos)) != std::string::npos) {
float spirvVersion;
Expand Down Expand Up @@ -222,7 +222,7 @@ int32_t GPUReconstructionOCL::InitDevice_Runtime()
}
}
}
if (GetProcessingSettings().oclPlatformNum >= 0) {
if (GetProcessingSettings().backend.platformNum >= 0) {
break;
}
}
Expand Down Expand Up @@ -521,10 +521,10 @@ int32_t GPUReconstructionOCL::GetOCLPrograms()
{
cl_int ocl_error;

const char* oclBuildFlags = GetProcessingSettings().oclOverrideSourceBuildFlags != "" ? GetProcessingSettings().oclOverrideSourceBuildFlags.c_str() : GPUCA_M_STR(GPUCA_OCL_BUILD_FLAGS);
const char* oclBuildFlags = GetProcessingSettings().backend.overrideSourceBuildFlags != "" ? GetProcessingSettings().backend.overrideSourceBuildFlags.c_str() : GPUCA_M_STR(GPUCA_OCL_BUILD_FLAGS);

#ifdef OPENCL_ENABLED_SPIRV // clang-format off
if (mOclVersion >= 2.1f && !GetProcessingSettings().oclCompileFromSources) {
if (mOclVersion >= 2.1f && !GetProcessingSettings().backend.compileFromSources) {
GPUInfo("Reading OpenCL program from SPIR-V IL (Platform version %4.2f)", mOclVersion);
mInternals->program = clCreateProgramWithIL(mInternals->context, _binary_GPUReconstructionOCLCode_spirv_start, _binary_GPUReconstructionOCLCode_spirv_len, &ocl_error);
oclBuildFlags = "";
Expand Down
15 changes: 13 additions & 2 deletions GPU/GPUTracking/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,9 @@ set(SRCS_DATATYPES DataTypes/GPUDataTypesConfig.cxx DataTypes/GPUConfigDump.cxx

set(ON_THE_FLY_DIR ${CMAKE_CURRENT_BINARY_DIR}/include_gpu_onthefly)
file(MAKE_DIRECTORY ${ON_THE_FLY_DIR})
file(TOUCH ${ON_THE_FLY_DIR}/.cmake_stamp)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${ON_THE_FLY_DIR}) # Files are generated at configure time, remove them with "make / ninja clean"
set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS ${ON_THE_FLY_DIR}/.cmake_stamp) # and rerun CMake afterwards to regenerate them, since the stamp is gone
include(cmake/gpu_settings_list_generator.cmake)
foreach(GPU_SETTINGS_LIST GPUSettingsList GPUSettingsListDisplay GPUSettingsListStandalone)
generate_gpu_settings_list(${CMAKE_CURRENT_SOURCE_DIR}/Definitions/${GPU_SETTINGS_LIST}.template ${ON_THE_FLY_DIR}/${GPU_SETTINGS_LIST}.h)
Expand Down Expand Up @@ -116,7 +119,6 @@ set(SRCS_NO_H SectorTracker/GPUTPCTrackerDump.cxx
Global/GPUChainTrackingIO.cxx)

set(HDRS_INSTALL
${GPU_SETTINGS_LIST_HEADERS}
${HDRS_CINT_O2}
${HDRS_CINT_DATATYPES}
${HDRS_CINT_O2_ADDITIONAL}
Expand Down Expand Up @@ -248,7 +250,7 @@ set(TEMPLATE_HEADER_LIST Base/GPUReconstructionKernelList.template.h
cmake/GPUNoFastMathKernels.template.h
Definitions/GPUDefParametersRuntime.template.h
Definitions/GPUDefParametersLoad.template.inc)
set(GENERATED_HEADERS_LIST "")
set(GENERATED_HEADERS_LIST ${GPU_SETTINGS_LIST_HEADERS})

foreach(TEMPLATE_FILE ${TEMPLATE_HEADER_LIST})
get_filename_component(OUTPUT_FILE_NAME ${TEMPLATE_FILE} NAME)
Expand All @@ -262,6 +264,7 @@ string(APPEND GPUDEFPARAMETERSLBLIST "$<JOIN:$<LIST:TRANSFORM,$<TARGET_PROPERTY:
file(GENERATE
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/GPUDefParametersLoadPrepareBase
CONTENT ${GPUDEFPARAMETERSLBLIST})
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/GPUDefParametersLoadPrepareBase)
add_custom_command(
OUTPUT ${ON_THE_FLY_DIR}/GPUDefParametersLoadPrepare.h
COMMAND awk "{print(\"#ifndef GPUCA_\" $0 \"\\n#define GPUCA_\" $0 \" 0\\n#endif\")}" ${CMAKE_CURRENT_BINARY_DIR}/GPUDefParametersLoadPrepareBase > ${ON_THE_FLY_DIR}/GPUDefParametersLoadPrepare.h
Expand Down Expand Up @@ -296,6 +299,7 @@ foreach(GPU_PARAM_JSON_FILE IN LISTS GPU_PARAM_JSON)
COMMAND_ERROR_IS_FATAL ANY
)
message(STATUS "Converted ${GPU_PARAM_JSON_FILE} to ${CONVOUTFILE}")
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/${CONVOUTFILE})
list(APPEND GPU_PARAM_JSON_FILES ${CMAKE_CURRENT_BINARY_DIR}/${CONVOUTFILE})
else()
list(APPEND GPU_PARAM_JSON_FILES ${GPU_PARAM_JSON_FILE})
Expand All @@ -315,6 +319,12 @@ file(GENERATE
list(APPEND GENERATED_HEADERS_LIST ${GPU_DEFAULT_PARAMS_HEADER} ${ON_THE_FLY_DIR}/GPUKernelsWith1Warp.inc)

set(HDRS_INSTALL ${HDRS_INSTALL} ${GENERATED_HEADERS_LIST})
file(GLOB GPU_STALE_GENERATED_HEADERS LIST_DIRECTORIES false ${ON_THE_FLY_DIR}/*.h ${ON_THE_FLY_DIR}/*.inc) # Remove headers of previous configurations, which are no longer generated
list(REMOVE_ITEM GPU_STALE_GENERATED_HEADERS ${GENERATED_HEADERS_LIST})
if(GPU_STALE_GENERATED_HEADERS)
message(STATUS "Removing stale generated GPU headers: ${GPU_STALE_GENERATED_HEADERS}")
file(REMOVE ${GPU_STALE_GENERATED_HEADERS})
endif()
include(kernels.cmake)

# Optional sources depending on optional dependencies
Expand Down Expand Up @@ -455,6 +465,7 @@ endif()

# GPUReconstructionLibrary needs to know which GPU backends are enabled for proper error messages
configure_file(Base/GPUReconstructionAvailableBackends.template.h ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionAvailableBackends.h)
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_CLEAN_FILES ${CMAKE_CURRENT_BINARY_DIR}/GPUReconstructionAvailableBackends.h)
set_source_files_properties(Base/GPUReconstructionLibrary.cxx
PROPERTIES
INCLUDE_DIRECTORIES "${CMAKE_CURRENT_BINARY_DIR}")
Expand Down
12 changes: 12 additions & 0 deletions GPU/GPUTracking/DataTypes/GPUConfigDump.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,25 @@
#define GPUSETTINGS_ALL
#include "GPUSettings.h"

#include <algorithm>
#include <functional>
#include <iterator>
#include <iostream>
#include <cstdio>
#include <string>
#include <tuple>
#include <type_traits>

#include "utils/qconfig_helpers.h"
#include "utils/qconfig_internal_helpers.h"

using namespace o2::gpu;

namespace
{
GPUSettingsStandalone configStandalone;
#include "utils/qconfig_print.inc"
#include "utils/qconfig_check.inc"
} // namespace

void GPUConfigDump::dumpConfig(const GPUSettingsRec* rec, const GPUSettingsProcessing* proc, const GPUSettingsQA* qa, const GPUSettingsDisplay* display, const GPUSettingsDeviceBackend* device, const GPURecoStepConfiguration* workflow)
Expand All @@ -55,3 +62,8 @@ void GPUConfigDump::dumpConfig(const GPUSettingsRec* rec, const GPUSettingsProce
printf("\n\tReconstruction steps / inputs / outputs:\n\tReco Steps = 0x%08x\n\tReco Steps GPU = 0x%08x\n\tInputs = 0x%08x\n\tOutputs = 0x%08x\n", (uint32_t)workflow->steps, (uint32_t)workflow->stepsGPUMask, (uint32_t)workflow->inputs, (uint32_t)workflow->outputs);
}
}

int32_t GPUConfigDump::checkConfig(const GPUSettingsProcessing& proc, const GPUSettingsDeviceBackend& device)
{
return qConfigCheck(device, proc, proc.rtc, proc.rtctech, proc.param, proc.nn, proc.scaling, proc.debug, proc.backend);
}
1 change: 1 addition & 0 deletions GPU/GPUTracking/DataTypes/GPUConfigDump.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ class GPUConfigDump
{
public:
static void dumpConfig(const GPUSettingsRec* rec, const GPUSettingsProcessing* proc, const GPUSettingsQA* qa, const GPUSettingsDisplay* display, const GPUSettingsDeviceBackend* device, const GPURecoStepConfiguration* workflow);
static int32_t checkConfig(const GPUSettingsProcessing& proc, const GPUSettingsDeviceBackend& device); // Evaluate the qcheck settings, returns the number of failed checks
};

} // namespace o2::gpu
Expand Down
15 changes: 10 additions & 5 deletions GPU/GPUTracking/Definitions/GPUSettingsList.template
Original file line number Diff line number Diff line change
Expand Up @@ -357,6 +357,15 @@ AddOption(mergerDumpTrackNCl, bool, false, "", 0, "Dump file with nCl per merged
AddHelp("help", 0)
EndConfig()

// Backend Settings
BeginSubConfig(GPUSettingsProcessingBackend, backend, configStandalone.proc, "BACKEND", 0, "Backend Settings", proc_backend)
AddOption(platformNum, int32_t, -1, "", 0, "Platform to use, in case the backend provides multiple platforms (OpenCL only, -1 = auto-select, -2 query all platforms (also incompatible))", qcheck(get<GPUSettingsDeviceBackend>().deviceType == gpudatatypes::DeviceType::OCL))
AddOption(compileFromSources, bool, false, "", 0, "Compile OpenCL binary from included source code instead of using included spirv code (OpenCL only)", qcheck(get<GPUSettingsDeviceBackend>().deviceType == gpudatatypes::DeviceType::OCL))
AddOption(overrideSourceBuildFlags, std::string, "", "", 0, "Override Backend build flags for compilation from source, put a space for empty options (OpenCL and Metal only)", qcheck(get<GPUSettingsDeviceBackend>().deviceType == gpudatatypes::DeviceType::OCL || get<GPUSettingsDeviceBackend>().deviceType == gpudatatypes::DeviceType::METAL))
AddOption(overrideEUSperCU, int32_t, -1, "", 0, "Override AMD_EUS_PER_CU setting (HIP only)", qcheck(get<GPUSettingsDeviceBackend>().deviceType == gpudatatypes::DeviceType::HIP))
AddHelp("help", 0)
EndConfig()

// Settings steering the processing once the device was selected, only available on the host
BeginSubConfig(GPUSettingsProcessing, proc, configStandalone, "PROC", 0, "Processing settings", proc)
AddOption(deviceNum, int32_t, -1, "gpuDevice", 0, "Set GPU device to use (-1: automatic, -2: for round-robin usage in timeslice-pipeline)")
Expand Down Expand Up @@ -432,11 +441,6 @@ AddOption(tpcApplyCFCutsAtDecoding, bool, false, "", 0, "Apply cluster cuts from
AddOption(tpcApplyClusterFilterOnCPU, uint8_t, 0, "", 0, "Apply custom cluster filter of GPUTPCClusterFilter class, 0: off, 1: debug, 2: PbPb23")
AddOption(tpcWriteClustersAfterRejection, bool, false, "", 0, "Apply TPC rejection strategy before writing clusters")
AddOption(tpcSortClusters, bool, false, "", 0, "Enforce sorting TPC clusters")
AddOption(oclPlatformNum, int32_t, -1, "", 0, "Platform to use, in case the backend provides multiple platforms (OpenCL only, -1 = auto-select, -2 query all platforms (also incompatible))") // TODO: Create some backend-specific options
AddOption(oclCompileFromSources, bool, false, "", 0, "Compile OpenCL binary from included source code instead of using included spirv code")
AddOption(oclOverrideSourceBuildFlags, std::string, "", "", 0, "Override OCL build flags for compilation from source, put a space for empty options")
AddOption(metalOverrideSourceBuildFlags, std::string, "", "", 0, "Override Metal build flags for compilation from source, put a space for empty options")
AddOption(hipOverrideAMDEUSperCU, int32_t, -1, "", 0, "Override AMD_EUS_PER_CU setting")
AddOption(printSettings, bool, false, "", 0, "Print all settings when initializing")
AddOption(tpcFreeAllocatedMemoryAfterProcessing, bool, false, "", 0, "Clean all memory allocated by TPC when TPC processing done, only data written to external output resources will remain")
AddOption(debugOnFailure, int32_t, 0, "", 0, "Dump raw data in case an error occured, bit 1 enables all dumps, otherwise bitmask for: 2 = signal, 3 = GPUErrorCode", def(1))
Expand All @@ -458,6 +462,7 @@ AddSubConfig(GPUSettingsProcessingParam, param)
AddSubConfig(GPUSettingsProcessingNNclusterizer, nn)
AddSubConfig(GPUSettingsProcessingScaling, scaling)
AddSubConfig(GPUSettingsProcessingDebug, debug)
AddSubConfig(GPUSettingsProcessingBackend, backend)
AddHelp("help", 0)
EndConfig()
#endif // !__OPENCL__ && !__METAL__
Expand Down
16 changes: 8 additions & 8 deletions GPU/GPUTracking/Merger/GPUTPCGMMerger.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ int64_t GPUTPCGMMerger::GetTrackLabelA(const S& trk) const
int32_t nClusters = 0;
if constexpr (std::is_same_v<S, GPUTPCGMBorderTrack&>) {
sectorTrack = &mSectorTrackInfos[trk.TrackID()];
nClusters = sectorTrack->OrigTrack()->NHits();
nClusters = sectorTrack->OrigTrack(this)->NHits();
} else {
nClusters = trk.NClusters();
}
Expand All @@ -199,7 +199,7 @@ int64_t GPUTPCGMMerger::GetTrackLabelA(const S& trk) const
int32_t id;
if constexpr (std::is_same_v<S, GPUTPCGMBorderTrack&>) {
const GPUTPCTracker& tracker = GetConstantMem()->tpcTrackers[sectorTrack->Sector()];
const GPUTPCHitId& ic = tracker.TrackHits()[sectorTrack->OrigTrack()->FirstHitID() + i];
const GPUTPCHitId& ic = tracker.TrackHits()[sectorTrack->OrigTrack(this)->FirstHitID() + i];
id = tracker.Data().ClusterDataIndex(tracker.Data().Row(ic.RowIndex()), ic.HitIndex()) + GetConstantMem()->ioPtrs.clustersNative->clusterOffset[sectorTrack->Sector()][0];
} else {
id = mClusters[trk.FirstClusterRef() + i].num;
Expand Down Expand Up @@ -667,7 +667,7 @@ GPUd() int32_t GPUTPCGMMerger::RefitSectorTrack(GPUTPCGMSectorTrack& sectorTrack
if (way) {
sectorTrack.SetParam2(trk);
} else {
sectorTrack.Set(trk, inTrack, alpha, sector);
sectorTrack.Set(this, trk, inTrack, alpha, sector);
}
}
return 0;
Expand Down Expand Up @@ -802,7 +802,7 @@ GPUd() void GPUTPCGMMerger::MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nT
const GPUTPCGMSectorTrack* trackMin = track;
while (track->NextSegmentNeighbour() >= 0 && track->Sector() == mSectorTrackInfos[track->NextSegmentNeighbour()].Sector()) {
track = &mSectorTrackInfos[track->NextSegmentNeighbour()];
if (track->OrigTrack()->Param().X() < trackMin->OrigTrack()->Param().X()) {
if (track->OrigTrack(this)->Param().X() < trackMin->OrigTrack(this)->Param().X()) {
trackMin = track;
}
}
Expand All @@ -811,7 +811,7 @@ GPUd() void GPUTPCGMMerger::MergeSectorsPrepareStep2(int32_t nBlocks, int32_t nT
if (trackTmp.X2() != 0.f) {
trackTmp.UseParam2();
} else {
trackTmp.Set(this, trackMin->OrigTrack(), trackMin->Alpha(), trackMin->Sector());
trackTmp.Set(this, trackMin->OrigTrack(this), trackMin->Alpha(), trackMin->Sector());
}
} else {
if (CAMath::Abs(track->QPt()) * Param().qptB5Scaler < Param().rec.tpc.mergerLooperSecondHorizontalQPtB5Limit) {
Expand Down Expand Up @@ -1630,9 +1630,9 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
const GPUTPCGMSectorTrack* trchk = &mSectorTrackInfos[ichk];
const GPUTPCGMSectorTrack* longest = trchk;
while (true) {
if (trchk->OrigTrack()->NHits() > length) {
if (trchk->OrigTrack(this)->NHits() > length) {
longest = trchk;
length = trchk->OrigTrack()->NHits();
length = trchk->OrigTrack(this)->NHits();
}
int32_t next = trchk->NextSegmentNeighbour();
if (next < 0 || (Param().rec.enableCyclicGraphWorkarounds && next == ichk)) {
Expand Down Expand Up @@ -1717,7 +1717,7 @@ GPUd() void GPUTPCGMMerger::CollectMergedTracks(int32_t nBlocks, int32_t nThread
trackCluster* c2 = trackClusters + nHits + nTrackHits - 1;
for (int32_t i = 0; i < nTrackHits; i++, c2--) {
const GPUTPCTracker& trk = GetConstantMem()->tpcTrackers[t->Sector()];
const GPUTPCHitId& ic = trk.TrackHits()[t->OrigTrack()->FirstHitID() + i];
const GPUTPCHitId& ic = trk.TrackHits()[t->OrigTrack(this)->FirstHitID() + i];
uint32_t id = trk.Data().ClusterDataIndex(trk.Data().Row(ic.RowIndex()), ic.HitIndex()) + GetConstantMem()->ioPtrs.clustersNative->clusterOffset[t->Sector()][0];
*c2 = trackCluster{id, (uint8_t)ic.RowIndex(), t->Sector()};
}
Expand Down
Loading