diff --git a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx index 66029daeea710..68b8d302d67e4 100644 --- a/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx +++ b/GPU/TPCFastTransformation/TPCFastSpaceChargeCorrection.cxx @@ -147,6 +147,7 @@ void TPCFastSpaceChargeCorrection::setActualBufferAddress(char* actualFlatBuffer } size_t bufferSize = scBufferOffset + scBufferSize; for (int32_t is = 0; is < 3; is++) { + bufferSize = alignSize(bufferSize, SplineType::getParameterAlignmentBytes()); mCorrectionData[is] = reinterpret_cast(mFlatBufferPtr + bufferSize); bufferSize += mSectorDataSizeBytes[is] * mGeo.getNumberOfSectors(); } @@ -255,7 +256,7 @@ void TPCFastSpaceChargeCorrection::setActualBufferAddress(char* actualFlatBuffer for (int32_t is = 0; is < 3; is++) { size_t oldCorrectionDataOffset = alignSize(oldBufferSize, SplineType::getParameterAlignmentBytes()); - size_t correctionDataOffset = bufferSize; + size_t correctionDataOffset = alignSize(bufferSize, SplineType::getParameterAlignmentBytes()); mCorrectionData[is] = reinterpret_cast(mFlatBufferPtr + correctionDataOffset); memmove(mCorrectionData[is], mFlatBufferPtr + oldCorrectionDataOffset, mSectorDataSizeBytes[is] * mGeo.getNumberOfSectors()); oldBufferSize = oldCorrectionDataOffset + mSectorDataSizeBytes[is] * mGeo.getNumberOfSectors(); @@ -508,6 +509,7 @@ void TPCFastSpaceChargeCorrection::finishConstruction() size_t bufferSize = scBufferOffsets[0] + scBufferSize; size_t correctionDataOffset[3]; for (int32_t is = 0; is < 3; is++) { + bufferSize = alignSize(bufferSize, SplineType::getParameterAlignmentBytes()); correctionDataOffset[is] = bufferSize; mSectorDataSizeBytes[is] = 0; for (int32_t j = 0; j < mGeo.getNumberOfRows(); j++) { @@ -524,6 +526,7 @@ void TPCFastSpaceChargeCorrection::finishConstruction() const SplineTypeInvYZ& splineInvYZ = reinterpret_cast(spline); mSectorDataSizeBytes[is] += splineInvYZ.getSizeOfParameters(); } + mSectorDataSizeBytes[is] = alignSize(mSectorDataSizeBytes[is], SplineType::getParameterAlignmentBytes()); } bufferSize += mSectorDataSizeBytes[is] * mGeo.getNumberOfSectors(); } diff --git a/GPU/TPCFastTransformation/TPCFastTransformPOD.cxx b/GPU/TPCFastTransformation/TPCFastTransformPOD.cxx index f6e61bdbbff70..e077c9144d7b4 100644 --- a/GPU/TPCFastTransformation/TPCFastTransformPOD.cxx +++ b/GPU/TPCFastTransformation/TPCFastTransformPOD.cxx @@ -67,6 +67,7 @@ size_t TPCFastTransformPOD::estimateSize(const TPCFastSpaceChargeCorrection& ori } // space for splines data for (int is = 0; is < 3; is++) { + nextDynOffs = FlatObject::alignSize(nextDynOffs, SplineType::getParameterAlignmentBytes()); nextDynOffs += origCorr.mSectorDataSizeBytes[is] * TPCFastTransformGeo::getNumberOfSectors(); } nextDynOffs = alignOffset(nextDynOffs); @@ -159,6 +160,7 @@ TPCFastTransformPOD* TPCFastTransformPOD::create(char* buff, size_t buffSize, co // copy spline data for (int is = 0; is < 3; is++) { + nextDynOffs = FlatObject::alignSize(nextDynOffs, SplineType::getParameterAlignmentBytes()); float* data = reinterpret_cast(buff + nextDynOffs); LOGP(debug, "splinID={} start offset {} -> {}", is, nextDynOffs, (void*)data);