@@ -224,7 +224,7 @@ GPUd() size_t GPUTPCCFDecodeZSLink::DecodePage(GPUSharedMemory& smem, processorT
224224 return pageDigitOffset;
225225 }
226226
227- int32_t nDecoded = 0 ;
227+ [[maybe_unused]] int32_t nDecoded = 0 ;
228228 const auto * decHdr = ConsumeHeader<TPCZSHDRV2>(page);
229229 ConsumeBytes (page, decHdr->firstZSDataOffset * 16 );
230230
@@ -275,7 +275,7 @@ GPUd() size_t GPUTPCCFDecodeZSLink::DecodePage(GPUSharedMemory& smem, processorT
275275#endif
276276 pageDigitOffset += nAdc;
277277 } // for (uint32_t t = 0; t < decHdr->nTimebinHeaders; t++)
278- ( void )nDecoded;
278+
279279#ifdef GPUCA_CHECK_TPCZS_CORRUPTION
280280 if (iThread == 0 && nDecoded != decHdr->nADCsamples ) {
281281 clusterer.raiseError (GPUErrors::ERROR_TPCZS_INVALID_NADC, clusterer.mISector * 1000 + decHdr->cruID , decHdr->nADCsamples , nDecoded);
@@ -566,6 +566,7 @@ GPUd() void GPUTPCCFDecodeZSLinkBase::WriteCharge(processorType& clusterer, floa
566566 positions[positionOffset] = pos;
567567
568568 charge *= clusterer.GetConstantMem ()->calibObjects .tpcPadGain ->getGainCorrection (sector, padAndRow.getRow (), padAndRow.getPad ());
569+
569570 chargeMap[pos] = PackedCharge (charge);
570571}
571572
@@ -615,6 +616,7 @@ GPUd() uint32_t GPUTPCCFDecodeZSDenseLink::DecodePage(GPUSharedMemory& smem, pro
615616 ConsumeBytes (page, decHeader->firstZSDataOffset - sizeof (o2::header::RAWDataHeader));
616617
617618 for (uint16_t i = 0 ; i < decHeader->nTimebinHeaders ; i++) {
619+
618620 [[maybe_unused]] ptrdiff_t sizeLeftInPage = payloadEnd - page;
619621 assert (sizeLeftInPage > 0 );
620622
@@ -728,8 +730,6 @@ GPUd() uint16_t GPUTPCCFDecodeZSDenseLink::DecodeTBMultiThread(
728730
729731 uint16_t nSamplesInTB = 0 ;
730732
731- GPUbarrier ();
732-
733733 // Read timebin link headers
734734 for (uint8_t iLink = 0 ; iLink < nLinksInTimebin; iLink++) {
735735 uint8_t timebinLinkHeaderStart = ConsumeByte (page);
@@ -777,15 +777,15 @@ GPUd() uint16_t GPUTPCCFDecodeZSDenseLink::DecodeTBMultiThread(
777777
778778 } // for (uint8_t iLink = 0; iLink < nLinksInTimebin; iLink++)
779779
780+ GPUbarrierWarp (); // Ensure all writes to shared memory are finished, before reading it
781+
780782 const uint8_t * adcData = ConsumeBytes (page, (nSamplesInTB * DECODE_BITS + 7 ) / 8 );
781783 MAYBE_PAGE_OVERFLOW (page); // TODO: We don't need this check?
782784
783785 if (not fragment.contains (timeBin)) {
784786 return FillWithInvalid (clusterer, iThread, NTHREADS, pageDigitOffset, nSamplesInTB);
785787 }
786788
787- GPUbarrier ();
788-
789789 // Unpack ADC
790790 int32_t iLink = 0 ;
791791 for (uint16_t sample = iThread; sample < nSamplesInTB; sample += NTHREADS) {
@@ -819,6 +819,8 @@ GPUd() uint16_t GPUTPCCFDecodeZSDenseLink::DecodeTBMultiThread(
819819
820820 } // for (uint16_t sample = iThread; sample < nSamplesInTB; sample += NTHREADS)
821821
822+ GPUbarrierWarp (); // Ensure all reads to shared memory are finished, before decoding next header into shmem
823+
822824 assert (PayloadExtendsToNextPage || adcData <= page);
823825 assert (PayloadExtendsToNextPage || page <= payloadEnd);
824826
0 commit comments