Skip to content

Commit

Permalink
Fix possible memory corruption in gpuVertexFinder (#419)
Browse files Browse the repository at this point in the history
  • Loading branch information
VinInn authored and fwyzard committed Dec 3, 2019
1 parent 41b1c42 commit 77ceafd
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions CUDADataFormats/Vertex/interface/ZVertexSoA.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@
// These vertices are clusterized and fitted only along the beam line (z)
// to obtain their global coordinate the beam spot position shall be added (eventually correcting for the beam angle as well)
struct ZVertexSoA {
static constexpr uint32_t MAXTRACKS = 32 * 1024;
static constexpr uint32_t MAXTRACKS = 16 * 1024;
static constexpr uint32_t MAXVTX = 1024;

int16_t idv[MAXTRACKS]; // vertex index for each associated (original) track (-1 == not associate)
float zv[MAXVTX]; // output z-posistion of found vertices
float wv[MAXVTX]; // output weight (1/error^2) on the above
float chi2[MAXVTX]; // vertices chi2
float ptv2[MAXVTX]; // vertices pt^2
int32_t ndof[MAXVTX]; // vertices number of dof (reused as workspace for the number of nearest neighbours)
int32_t ndof[MAXTRACKS]; // vertices number of dof (reused as workspace for the number of nearest neighbours FIXME)
uint16_t sortInd[MAXVTX]; // sorted index (by pt2) ascending
uint32_t nvFinal; // the number of vertices

Expand Down
4 changes: 2 additions & 2 deletions RecoPixelVertexing/PixelVertexFinding/src/gpuVertexFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ namespace gpuVertexFinder {

// workspace used in the vertex reco algos
struct WorkSpace {
static constexpr uint32_t MAXTRACKS = 16000;
static constexpr uint32_t MAXVTX = 1024;
static constexpr uint32_t MAXTRACKS = ZVertexSoA::MAXTRACKS;
static constexpr uint32_t MAXVTX = ZVertexSoA::MAXVTX;

uint32_t ntrks; // number of "selected tracks"
uint16_t itrk[MAXTRACKS]; // index of original track
Expand Down

0 comments on commit 77ceafd

Please sign in to comment.