Skip to content

Commit 4c4e004

Browse files
committed
GPU: Clean up some unused parameters
1 parent e3b82a8 commit 4c4e004

File tree

4 files changed

+11
-18
lines changed

4 files changed

+11
-18
lines changed

GPU/GPUTracking/Base/GPUReconstruction.cxx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -449,7 +449,7 @@ int32_t GPUReconstruction::Exit()
449449
if (mMemoryResources[i].mReuse >= 0) {
450450
continue;
451451
}
452-
operator delete(mMemoryResources[i].mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
452+
operator delete(mMemoryResources[i].mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
453453
mMemoryResources[i].mPtr = mMemoryResources[i].mPtrDevice = nullptr;
454454
}
455455
}
@@ -577,7 +577,7 @@ void GPUReconstruction::AllocateRegisteredMemoryInternal(GPUMemoryResource* res,
577577
if (mProcessingSettings.memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_INDIVIDUAL && (control == nullptr || control->useInternal())) {
578578
if (!(res->mType & GPUMemoryResource::MEMORY_EXTERNAL)) {
579579
if (res->mPtrDevice && res->mReuse < 0) {
580-
operator delete(res->mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
580+
operator delete(res->mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
581581
}
582582
res->mSize = std::max((size_t)res->SetPointers((void*)1) - 1, res->mOverrideSize);
583583
if (res->mReuse >= 0) {
@@ -587,7 +587,7 @@ void GPUReconstruction::AllocateRegisteredMemoryInternal(GPUMemoryResource* res,
587587
}
588588
res->mPtrDevice = mMemoryResources[res->mReuse].mPtrDevice;
589589
} else {
590-
res->mPtrDevice = operator new(res->mSize + GPUCA_BUFFER_ALIGNMENT GPUCA_OPERATOR_NEW_ALIGNMENT);
590+
res->mPtrDevice = operator new(res->mSize + GPUCA_BUFFER_ALIGNMENT, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
591591
}
592592
res->mPtr = GPUProcessor::alignPointer<GPUCA_BUFFER_ALIGNMENT>(res->mPtrDevice);
593593
res->SetPointers(res->mPtr);
@@ -775,7 +775,7 @@ void GPUReconstruction::FreeRegisteredMemory(GPUMemoryResource* res)
775775
std::cout << "Freeing " << res->mName << ": size " << res->mSize << " (reused " << res->mReuse << ")\n";
776776
}
777777
if (mProcessingSettings.memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_INDIVIDUAL && res->mReuse < 0) {
778-
operator delete(res->mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
778+
operator delete(res->mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
779779
}
780780
res->mPtr = nullptr;
781781
res->mPtrDevice = nullptr;
@@ -825,7 +825,7 @@ void GPUReconstruction::PopNonPersistentMemory(RecoStep step, uint64_t tag)
825825
for (uint32_t i = std::get<2>(mNonPersistentMemoryStack.back()); i < mNonPersistentIndividualAllocations.size(); i++) {
826826
GPUMemoryResource* res = mNonPersistentIndividualAllocations[i];
827827
if (res->mReuse < 0) {
828-
operator delete(res->mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
828+
operator delete(res->mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
829829
}
830830
res->mPtr = nullptr;
831831
res->mPtrDevice = nullptr;

GPU/GPUTracking/Base/GPUReconstructionCPU.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,7 +202,7 @@ int32_t GPUReconstructionCPU::InitDevice()
202202
if (mDeviceMemorySize > mHostMemorySize) {
203203
mHostMemorySize = mDeviceMemorySize;
204204
}
205-
mHostMemoryBase = operator new(mHostMemorySize GPUCA_OPERATOR_NEW_ALIGNMENT);
205+
mHostMemoryBase = operator new(mHostMemorySize, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
206206
}
207207
mHostMemoryPermanent = mHostMemoryBase;
208208
ClearAllocatedMemory();
@@ -218,7 +218,7 @@ int32_t GPUReconstructionCPU::ExitDevice()
218218
{
219219
if (mProcessingSettings.memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_GLOBAL) {
220220
if (mMaster == nullptr) {
221-
operator delete(mHostMemoryBase GPUCA_OPERATOR_NEW_ALIGNMENT);
221+
operator delete(mHostMemoryBase, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
222222
}
223223
mHostMemoryPool = mHostMemoryBase = mHostMemoryPoolEnd = mHostMemoryPermanent = nullptr;
224224
mHostMemorySize = 0;

GPU/GPUTracking/Definitions/GPUDefParametersDefault.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -594,14 +594,11 @@
594594
#define GPUCA_MAX_CLUSTERS ((size_t) 1024 * 1024 * 1024) // Maximum number of TPC clusters
595595
#define GPUCA_MAX_TRD_TRACKLETS ((size_t) 128 * 1024) // Maximum number of TRD tracklets
596596
#define GPUCA_MAX_ITS_FIT_TRACKS ((size_t) 96 * 1024) // Max number of tracks for ITS track fit
597-
#define GPUCA_TRACKER_CONSTANT_MEM ((size_t) 63 * 1024) // Amount of Constant Memory to reserve
598597
#define GPUCA_MEMORY_SIZE ((size_t) 6 * 1024 * 1024 * 1024) // Size of memory allocated on Device
599598
#define GPUCA_HOST_MEMORY_SIZE ((size_t) 1 * 1024 * 1024 * 1024) // Size of memory allocated on Host
600599
#define GPUCA_GPU_STACK_SIZE ((size_t) 8 * 1024) // Stack size per GPU thread
601600
#define GPUCA_GPU_HEAP_SIZE ((size_t) 16 * 1025 * 1024) // Stack size per GPU thread
602601

603-
#define GPUCA_MAX_SECTOR_NTRACK (2 << 24) // Maximum number of tracks per sector (limited by track id format)
604-
605602
// #define GPUCA_KERNEL_DEBUGGER_OUTPUT
606603

607604
// Some assertions to make sure the parameters are not invalid
@@ -614,14 +611,10 @@
614611
// Derived parameters
615612
#ifdef GPUCA_USE_TEXTURES
616613
#define GPUCA_TEXTURE_FETCH_CONSTRUCTOR // Fetch data through texture cache
617-
#define GPUCA_TEXTURE_FETCH_NEIGHBORS // Fetch also in Neighbours Finder
618614
#endif
619615
#if defined(GPUCA_SORT_STARTHITS_GPU) && defined(GPUCA_GPUCODE)
620616
#define GPUCA_SORT_STARTHITS
621617
#endif
622618

623-
#define GPUCA_NEW_ALIGNMENT (std::align_val_t{GPUCA_BUFFER_ALIGNMENT})
624-
#define GPUCA_OPERATOR_NEW_ALIGNMENT ,GPUCA_NEW_ALIGNMENT
625-
626619
// clang-format on
627620
#endif // GPUDEFPARAMETERSDEFAULT_H

GPU/GPUTracking/Standalone/Benchmark/standalone.cxx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ GPUChainTracking *chainTracking, *chainTrackingAsync, *chainTrackingPipeline;
7171
GPUChainITS *chainITS, *chainITSAsync, *chainITSPipeline;
7272
void unique_ptr_aligned_delete(char* v)
7373
{
74-
operator delete(v GPUCA_OPERATOR_NEW_ALIGNMENT);
74+
operator delete(v, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
7575
}
7676
std::unique_ptr<char, void (*)(char*)> outputmemory(nullptr, unique_ptr_aligned_delete), outputmemoryPipeline(nullptr, unique_ptr_aligned_delete), inputmemory(nullptr, unique_ptr_aligned_delete);
7777
std::unique_ptr<GPUDisplayFrontendInterface> eventDisplay;
@@ -221,20 +221,20 @@ int32_t ReadConfiguration(int argc, char** argv)
221221

222222
if (configStandalone.outputcontrolmem) {
223223
bool forceEmptyMemory = getenv("LD_PRELOAD") && strstr(getenv("LD_PRELOAD"), "valgrind") != nullptr;
224-
outputmemory.reset((char*)operator new(configStandalone.outputcontrolmem GPUCA_OPERATOR_NEW_ALIGNMENT));
224+
outputmemory.reset((char*)operator new(configStandalone.outputcontrolmem, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)));
225225
if (forceEmptyMemory) {
226226
printf("Valgrind detected, emptying GPU output memory to avoid false positive undefined reads");
227227
memset(outputmemory.get(), 0, configStandalone.outputcontrolmem);
228228
}
229229
if (configStandalone.proc.doublePipeline) {
230-
outputmemoryPipeline.reset((char*)operator new(configStandalone.outputcontrolmem GPUCA_OPERATOR_NEW_ALIGNMENT));
230+
outputmemoryPipeline.reset((char*)operator new(configStandalone.outputcontrolmem, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)));
231231
if (forceEmptyMemory) {
232232
memset(outputmemoryPipeline.get(), 0, configStandalone.outputcontrolmem);
233233
}
234234
}
235235
}
236236
if (configStandalone.inputcontrolmem) {
237-
inputmemory.reset((char*)operator new(configStandalone.inputcontrolmem GPUCA_OPERATOR_NEW_ALIGNMENT));
237+
inputmemory.reset((char*)operator new(configStandalone.inputcontrolmem, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)));
238238
}
239239

240240
configStandalone.proc.showOutputStat = true;

0 commit comments

Comments
 (0)