Skip to content
Merged
Show file tree
Hide file tree
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
10 changes: 5 additions & 5 deletions GPU/GPUTracking/Base/GPUReconstruction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -449,7 +449,7 @@ int32_t GPUReconstruction::Exit()
if (mMemoryResources[i].mReuse >= 0) {
continue;
}
operator delete(mMemoryResources[i].mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
operator delete(mMemoryResources[i].mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
mMemoryResources[i].mPtr = mMemoryResources[i].mPtrDevice = nullptr;
}
}
Expand Down Expand Up @@ -577,7 +577,7 @@ void GPUReconstruction::AllocateRegisteredMemoryInternal(GPUMemoryResource* res,
if (mProcessingSettings.memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_INDIVIDUAL && (control == nullptr || control->useInternal())) {
if (!(res->mType & GPUMemoryResource::MEMORY_EXTERNAL)) {
if (res->mPtrDevice && res->mReuse < 0) {
operator delete(res->mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
operator delete(res->mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
}
res->mSize = std::max((size_t)res->SetPointers((void*)1) - 1, res->mOverrideSize);
if (res->mReuse >= 0) {
Expand All @@ -587,7 +587,7 @@ void GPUReconstruction::AllocateRegisteredMemoryInternal(GPUMemoryResource* res,
}
res->mPtrDevice = mMemoryResources[res->mReuse].mPtrDevice;
} else {
res->mPtrDevice = operator new(res->mSize + GPUCA_BUFFER_ALIGNMENT GPUCA_OPERATOR_NEW_ALIGNMENT);
res->mPtrDevice = operator new(res->mSize + GPUCA_BUFFER_ALIGNMENT, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
}
res->mPtr = GPUProcessor::alignPointer<GPUCA_BUFFER_ALIGNMENT>(res->mPtrDevice);
res->SetPointers(res->mPtr);
Expand Down Expand Up @@ -775,7 +775,7 @@ void GPUReconstruction::FreeRegisteredMemory(GPUMemoryResource* res)
std::cout << "Freeing " << res->mName << ": size " << res->mSize << " (reused " << res->mReuse << ")\n";
}
if (mProcessingSettings.memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_INDIVIDUAL && res->mReuse < 0) {
operator delete(res->mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
operator delete(res->mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
}
res->mPtr = nullptr;
res->mPtrDevice = nullptr;
Expand Down Expand Up @@ -825,7 +825,7 @@ void GPUReconstruction::PopNonPersistentMemory(RecoStep step, uint64_t tag)
for (uint32_t i = std::get<2>(mNonPersistentMemoryStack.back()); i < mNonPersistentIndividualAllocations.size(); i++) {
GPUMemoryResource* res = mNonPersistentIndividualAllocations[i];
if (res->mReuse < 0) {
operator delete(res->mPtrDevice GPUCA_OPERATOR_NEW_ALIGNMENT);
operator delete(res->mPtrDevice, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
}
res->mPtr = nullptr;
res->mPtrDevice = nullptr;
Expand Down
4 changes: 2 additions & 2 deletions GPU/GPUTracking/Base/GPUReconstructionCPU.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ int32_t GPUReconstructionCPU::InitDevice()
if (mDeviceMemorySize > mHostMemorySize) {
mHostMemorySize = mDeviceMemorySize;
}
mHostMemoryBase = operator new(mHostMemorySize GPUCA_OPERATOR_NEW_ALIGNMENT);
mHostMemoryBase = operator new(mHostMemorySize, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
}
mHostMemoryPermanent = mHostMemoryBase;
ClearAllocatedMemory();
Expand All @@ -218,7 +218,7 @@ int32_t GPUReconstructionCPU::ExitDevice()
{
if (mProcessingSettings.memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_GLOBAL) {
if (mMaster == nullptr) {
operator delete(mHostMemoryBase GPUCA_OPERATOR_NEW_ALIGNMENT);
operator delete(mHostMemoryBase, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
}
mHostMemoryPool = mHostMemoryBase = mHostMemoryPoolEnd = mHostMemoryPermanent = nullptr;
mHostMemorySize = 0;
Expand Down
7 changes: 0 additions & 7 deletions GPU/GPUTracking/Definitions/GPUDefParametersDefault.h
Original file line number Diff line number Diff line change
Expand Up @@ -594,14 +594,11 @@
#define GPUCA_MAX_CLUSTERS ((size_t) 1024 * 1024 * 1024) // Maximum number of TPC clusters
#define GPUCA_MAX_TRD_TRACKLETS ((size_t) 128 * 1024) // Maximum number of TRD tracklets
#define GPUCA_MAX_ITS_FIT_TRACKS ((size_t) 96 * 1024) // Max number of tracks for ITS track fit
#define GPUCA_TRACKER_CONSTANT_MEM ((size_t) 63 * 1024) // Amount of Constant Memory to reserve
#define GPUCA_MEMORY_SIZE ((size_t) 6 * 1024 * 1024 * 1024) // Size of memory allocated on Device
#define GPUCA_HOST_MEMORY_SIZE ((size_t) 1 * 1024 * 1024 * 1024) // Size of memory allocated on Host
#define GPUCA_GPU_STACK_SIZE ((size_t) 8 * 1024) // Stack size per GPU thread
#define GPUCA_GPU_HEAP_SIZE ((size_t) 16 * 1025 * 1024) // Stack size per GPU thread

#define GPUCA_MAX_SECTOR_NTRACK (2 << 24) // Maximum number of tracks per sector (limited by track id format)

// #define GPUCA_KERNEL_DEBUGGER_OUTPUT

// Some assertions to make sure the parameters are not invalid
Expand All @@ -614,14 +611,10 @@
// Derived parameters
#ifdef GPUCA_USE_TEXTURES
#define GPUCA_TEXTURE_FETCH_CONSTRUCTOR // Fetch data through texture cache
#define GPUCA_TEXTURE_FETCH_NEIGHBORS // Fetch also in Neighbours Finder
#endif
#if defined(GPUCA_SORT_STARTHITS_GPU) && defined(GPUCA_GPUCODE)
#define GPUCA_SORT_STARTHITS
#endif

#define GPUCA_NEW_ALIGNMENT (std::align_val_t{GPUCA_BUFFER_ALIGNMENT})
#define GPUCA_OPERATOR_NEW_ALIGNMENT ,GPUCA_NEW_ALIGNMENT

// clang-format on
#endif // GPUDEFPARAMETERSDEFAULT_H
8 changes: 4 additions & 4 deletions GPU/GPUTracking/Standalone/Benchmark/standalone.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ GPUChainTracking *chainTracking, *chainTrackingAsync, *chainTrackingPipeline;
GPUChainITS *chainITS, *chainITSAsync, *chainITSPipeline;
void unique_ptr_aligned_delete(char* v)
{
operator delete(v GPUCA_OPERATOR_NEW_ALIGNMENT);
operator delete(v, std::align_val_t(GPUCA_BUFFER_ALIGNMENT));
}
std::unique_ptr<char, void (*)(char*)> outputmemory(nullptr, unique_ptr_aligned_delete), outputmemoryPipeline(nullptr, unique_ptr_aligned_delete), inputmemory(nullptr, unique_ptr_aligned_delete);
std::unique_ptr<GPUDisplayFrontendInterface> eventDisplay;
Expand Down Expand Up @@ -221,20 +221,20 @@ int32_t ReadConfiguration(int argc, char** argv)

if (configStandalone.outputcontrolmem) {
bool forceEmptyMemory = getenv("LD_PRELOAD") && strstr(getenv("LD_PRELOAD"), "valgrind") != nullptr;
outputmemory.reset((char*)operator new(configStandalone.outputcontrolmem GPUCA_OPERATOR_NEW_ALIGNMENT));
outputmemory.reset((char*)operator new(configStandalone.outputcontrolmem, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)));
if (forceEmptyMemory) {
printf("Valgrind detected, emptying GPU output memory to avoid false positive undefined reads");
memset(outputmemory.get(), 0, configStandalone.outputcontrolmem);
}
if (configStandalone.proc.doublePipeline) {
outputmemoryPipeline.reset((char*)operator new(configStandalone.outputcontrolmem GPUCA_OPERATOR_NEW_ALIGNMENT));
outputmemoryPipeline.reset((char*)operator new(configStandalone.outputcontrolmem, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)));
if (forceEmptyMemory) {
memset(outputmemoryPipeline.get(), 0, configStandalone.outputcontrolmem);
}
}
}
if (configStandalone.inputcontrolmem) {
inputmemory.reset((char*)operator new(configStandalone.inputcontrolmem GPUCA_OPERATOR_NEW_ALIGNMENT));
inputmemory.reset((char*)operator new(configStandalone.inputcontrolmem, std::align_val_t(GPUCA_BUFFER_ALIGNMENT)));
}

configStandalone.proc.showOutputStat = true;
Expand Down