Skip to content

Commit 54d893a

Browse files
committed
GPU: Use half as storage type for interpolation errors on NVIDIA
1 parent 9afcdc5 commit 54d893a

3 files changed

Lines changed: 11 additions & 9 deletions

File tree

GPU/Common/GPUDefGPUParameters.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -136,6 +136,7 @@
136136
#define GPUCA_NO_ATOMIC_PRECHECK 1
137137
#define GPUCA_COMP_GATHER_KERNEL 0
138138
#define GPUCA_DEDX_STORAGE_TYPE unsigned short
139+
#define GPUCA_MERGER_INTERPOLATION_ERROR_TYPE half
139140
// #define GPUCA_USE_TEXTURES
140141
#elif defined(GPUCA_GPUTYPE_OPENCL)
141142
#elif defined(GPUCA_GPUCODE)
@@ -358,6 +359,9 @@
358359
#ifndef GPUCA_DEDX_STORAGE_TYPE
359360
#define GPUCA_DEDX_STORAGE_TYPE float
360361
#endif
362+
#ifndef GPUCA_MERGER_INTERPOLATION_ERROR_TYPE
363+
#define GPUCA_MERGER_INTERPOLATION_ERROR_TYPE float
364+
#endif
361365

362366
#ifndef GPUCA_WARP_SIZE
363367
#ifdef GPUCA_GPUCODE

GPU/GPUTracking/Merger/GPUTPCGMMergerTypes.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,8 @@ enum attachTypes { attachAttached = 0x40000000,
3333
attachFlagMask = 0xFC000000 };
3434

3535
struct InterpolationErrorHit {
36-
float posY;
37-
float errorY;
38-
float posZ;
39-
float errorZ;
36+
float posY, posZ;
37+
GPUCA_MERGER_INTERPOLATION_ERROR_TYPE errorY, errorZ;
4038
};
4139

4240
struct InterpolationErrors {

GPU/GPUTracking/Merger/GPUTPCGMPropagator.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -642,7 +642,7 @@ GPUd() int GPUTPCGMPropagator::Update(float posY, float posZ, int iRow, const GP
642642
GetErr2(err2Y, err2Z, param, posZ, iRow, clusterState);
643643

644644
if (rejectChi2 >= 2) {
645-
if (rejectChi2 == 3 && inter->errorY < 0) {
645+
if (rejectChi2 == 3 && inter->errorY < (GPUCA_MERGER_INTERPOLATION_ERROR_TYPE)0) {
646646
rejectChi2 = 1;
647647
} else {
648648
int retVal = InterpolateReject(posY, posZ, clusterState, rejectChi2, inter, err2Y, err2Z);
@@ -686,8 +686,8 @@ GPUd() int GPUTPCGMPropagator::InterpolateReject(float posY, float posZ, short c
686686
if (mFitInProjections || mT->NDF() <= 0) {
687687
const float Iz0 = inter->posY - mP[0];
688688
const float Iz1 = inter->posZ - mP[1];
689-
const float Iw0 = 1.f / (mC[0] + inter->errorY);
690-
const float Iw2 = 1.f / (mC[2] + inter->errorZ);
689+
const float Iw0 = 1.f / (mC[0] + (float)inter->errorY);
690+
const float Iw2 = 1.f / (mC[2] + (float)inter->errorZ);
691691
const float Ik00 = mC[0] * Iw0;
692692
const float Ik11 = mC[2] * Iw2;
693693
const float ImP0 = mP[0] + Ik00 * Iz0;
@@ -704,8 +704,8 @@ GPUd() int GPUTPCGMPropagator::InterpolateReject(float posY, float posZ, short c
704704
} else {
705705
const float Iz0 = inter->posY - mP[0];
706706
const float Iz1 = inter->posZ - mP[1];
707-
float Iw0 = mC[2] + inter->errorZ;
708-
float Iw2 = mC[0] + inter->errorY;
707+
float Iw0 = mC[2] + (float)inter->errorZ;
708+
float Iw2 = mC[0] + (float)inter->errorY;
709709
float Idet = CAMath::Max(1e-10f, Iw0 * Iw2 - mC[1] * mC[1]);
710710
Idet = 1.f / Idet;
711711
Iw0 *= Idet;

0 commit comments

Comments
 (0)