Skip to content
This repository has been archived by the owner on Dec 9, 2024. It is now read-only.

Fix pT3 and pT5 construction #389

Merged
merged 3 commits into from
Apr 22, 2024
Merged
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
22 changes: 12 additions & 10 deletions SDL/Event.cc
Original file line number Diff line number Diff line change
Expand Up @@ -851,17 +851,18 @@ void SDL::Event<SDL::Acc>::createPixelTriplets() {
unsigned int* connectedPixelIndex_host = alpaka::getPtrNative(connectedPixelIndex_host_buf);
alpaka::wait(queue);

int pixelIndexOffsetPos = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndex[44999] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizes[44999];
int pixelIndexOffsetNeg = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndexPos[44999] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizes[44999] + pixelIndexOffsetPos;
int pixelIndexOffsetPos = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndex[size_superbins - 1] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizes[size_superbins - 1];
int pixelIndexOffsetNeg = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndexPos[size_superbins - 1] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizesPos[size_superbins - 1] +
pixelIndexOffsetPos;

// TODO: check if a map/reduction to just eligible pLSs would speed up the kernel
// the current selection still leaves a significant fraction of unmatchable pLSs
for (unsigned int i = 0; i < nInnerSegments; i++) { // loop over # pLS
int8_t pixelType = pixelTypes[i]; // Get pixel type for this pLS
int superbin = superbins[i]; // Get superbin for this pixel
if ((superbin < 0) or (superbin >= 45000) or (pixelType > 2) or (pixelType < 0)) {
if ((superbin < 0) or (superbin >= (int)size_superbins) or (pixelType > 2) or (pixelType < 0)) {
connectedPixelSize_host[i] = 0;
connectedPixelIndex_host[i] = 0;
continue;
Expand Down Expand Up @@ -1085,16 +1086,17 @@ void SDL::Event<SDL::Acc>::createPixelQuintuplets() {
unsigned int* connectedPixelIndex_host = alpaka::getPtrNative(connectedPixelIndex_host_buf);
alpaka::wait(queue);

int pixelIndexOffsetPos = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndex[44999] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizes[44999];
int pixelIndexOffsetNeg = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndexPos[44999] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizes[44999] + pixelIndexOffsetPos;
int pixelIndexOffsetPos = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndex[size_superbins - 1] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizes[size_superbins - 1];
int pixelIndexOffsetNeg = Globals<SDL::Dev>::pixelMapping->connectedPixelsIndexPos[size_superbins - 1] +
Globals<SDL::Dev>::pixelMapping->connectedPixelsSizesPos[size_superbins - 1] +
pixelIndexOffsetPos;

// Loop over # pLS
for (unsigned int i = 0; i < nInnerSegments; i++) {
int8_t pixelType = pixelTypes[i]; // Get pixel type for this pLS
int superbin = superbins[i]; // Get superbin for this pixel
if ((superbin < 0) or (superbin >= 45000) or (pixelType > 2) or (pixelType < 0)) {
if ((superbin < 0) or (superbin >= (int)size_superbins) or (pixelType > 2) or (pixelType < 0)) {
connectedPixelIndex_host[i] = 0;
connectedPixelSize_host[i] = 0;
continue;
Expand Down