|
20 | 20 | #include "GPUTPCCompressionTrackModel.h" |
21 | 21 | #include "GPUTPCGeometry.h" |
22 | 22 | #include "GPUTPCClusterRejection.h" |
| 23 | +#include "GPUTPCCompressionKernels.inc" |
23 | 24 |
|
24 | 25 | using namespace GPUCA_NAMESPACE::gpu; |
25 | 26 | using namespace o2::tpc; |
@@ -272,25 +273,9 @@ GPUdii() void GPUTPCCompressionKernels::Thread<GPUTPCCompressionKernels::step1un |
272 | 273 | for (unsigned int j = get_local_id(0); j < count; j += get_local_size(0)) { |
273 | 274 | int outidx = idOffsetOut + totalCount + j; |
274 | 275 | const ClusterNative& GPUrestrict() orgCl = clusters->clusters[iSlice][iRow][sortBuffer[j]]; |
275 | | - unsigned int lastTime = 0; |
276 | | - unsigned int lastPad = 0; |
277 | | - if (param.rec.tpc.compressionTypeMask & GPUSettings::CompressionDifferences) { |
278 | | - if (j != 0) { |
279 | | - const ClusterNative& GPUrestrict() orgClPre = clusters->clusters[iSlice][iRow][sortBuffer[j - 1]]; |
280 | | - lastPad = orgClPre.padPacked; |
281 | | - lastTime = orgClPre.getTimePacked(); |
282 | | - } else if (totalCount != 0) { |
283 | | - const ClusterNative& GPUrestrict() orgClPre = clusters->clusters[iSlice][iRow][smem.lastIndex]; |
284 | | - lastPad = orgClPre.padPacked; |
285 | | - lastTime = orgClPre.getTimePacked(); |
286 | | - } |
287 | 276 |
|
288 | | - c.padDiffU[outidx] = orgCl.padPacked - lastPad; |
289 | | - c.timeDiffU[outidx] = (orgCl.getTimePacked() - lastTime) & 0xFFFFFF; |
290 | | - } else { |
291 | | - c.padDiffU[outidx] = orgCl.padPacked; |
292 | | - c.timeDiffU[outidx] = orgCl.getTimePacked(); |
293 | | - } |
| 277 | + int preId = j != 0 ? (int)sortBuffer[j - 1] : (totalCount != 0 ? (int)smem.lastIndex : -1); |
| 278 | + GPUTPCCompression_EncodeUnattached(param, orgCl, c, outidx, preId == -1 ? nullptr : &clusters->clusters[iSlice][iRow][preId]); |
294 | 279 |
|
295 | 280 | unsigned short qtot = orgCl.qTot, qmax = orgCl.qMax; |
296 | 281 | unsigned char sigmapad = orgCl.sigmaPadPacked, sigmatime = orgCl.sigmaTimePacked; |
|
0 commit comments