@@ -74,7 +74,7 @@ constexpr const char* const GPUReconstruction::GEOMETRY_TYPE_NAMES[];
7474constexpr const char * const GPUReconstruction::IOTYPENAMES[];
7575constexpr GPUReconstruction::GeometryType GPUReconstruction::geometryType;
7676
77- static int64_t ptrDiff (void * a, void * b) { return (int64_t )(( char *)a - (char *)b) ; }
77+ static ptrdiff_t ptrDiff (void * a, void * b) { return (char *)a - (char *)b; }
7878
7979GPUReconstruction::GPUReconstruction (const GPUSettingsDeviceBackend& cfg) : mHostConstantMem(new GPUConstantMem), mDeviceBackendSettings(cfg)
8080{
@@ -834,9 +834,9 @@ void GPUReconstruction::PopNonPersistentMemory(RecoStep step, uint64_t tag)
834834 }
835835 if ((mProcessingSettings .debugLevel >= 3 || mProcessingSettings .allocDebugLevel ) && (IsGPU () || mProcessingSettings .forceHostMemoryPoolSize )) {
836836 if (IsGPU ()) {
837- printf (" Allocated Device memory after %30s (%8s): %'13ld (non temporary %'13ld , blocked %'13ld )\n " , GPUDataTypes::RECO_STEP_NAMES[getRecoStepNum (step, true )], qTag2Str (std::get<3 >(mNonPersistentMemoryStack .back ())).c_str (), ptrDiff (mDeviceMemoryPool , mDeviceMemoryBase ) + ptrDiff ((char *)mDeviceMemoryBase + mDeviceMemorySize , mDeviceMemoryPoolEnd ), ptrDiff (mDeviceMemoryPool , mDeviceMemoryBase ), mDeviceMemoryPoolBlocked == nullptr ? 0l : ptrDiff ((char *)mDeviceMemoryBase + mDeviceMemorySize , mDeviceMemoryPoolBlocked ));
837+ printf (" Allocated Device memory after %30s (%8s): %'13zd (non temporary %'13zd , blocked %'13zd )\n " , GPUDataTypes::RECO_STEP_NAMES[getRecoStepNum (step, true )], qTag2Str (std::get<3 >(mNonPersistentMemoryStack .back ())).c_str (), ptrDiff (mDeviceMemoryPool , mDeviceMemoryBase ) + ptrDiff ((char *)mDeviceMemoryBase + mDeviceMemorySize , mDeviceMemoryPoolEnd ), ptrDiff (mDeviceMemoryPool , mDeviceMemoryBase ), mDeviceMemoryPoolBlocked ? ptrDiff ((char *)mDeviceMemoryBase + mDeviceMemorySize , mDeviceMemoryPoolBlocked ) : 0 );
838838 }
839- printf (" Allocated Host memory after %30s (%8s): %'13ld (non temporary %'13ld , blocked %'13ld )\n " , GPUDataTypes::RECO_STEP_NAMES[getRecoStepNum (step, true )], qTag2Str (std::get<3 >(mNonPersistentMemoryStack .back ())).c_str (), ptrDiff (mHostMemoryPool , mHostMemoryBase ) + ptrDiff ((char *)mHostMemoryBase + mHostMemorySize , mHostMemoryPoolEnd ), ptrDiff (mHostMemoryPool , mHostMemoryBase ), mHostMemoryPoolBlocked == nullptr ? 0l : ptrDiff ((char *)mHostMemoryBase + mHostMemorySize , mHostMemoryPoolBlocked ));
839+ printf (" Allocated Host memory after %30s (%8s): %'13zd (non temporary %'13zd , blocked %'13zd )\n " , GPUDataTypes::RECO_STEP_NAMES[getRecoStepNum (step, true )], qTag2Str (std::get<3 >(mNonPersistentMemoryStack .back ())).c_str (), ptrDiff (mHostMemoryPool , mHostMemoryBase ) + ptrDiff ((char *)mHostMemoryBase + mHostMemorySize , mHostMemoryPoolEnd ), ptrDiff (mHostMemoryPool , mHostMemoryBase ), mHostMemoryPoolBlocked ? ptrDiff ((char *)mHostMemoryBase + mHostMemorySize , mHostMemoryPoolBlocked ) : 0 );
840840 printf (" %16s" , " " );
841841 PrintMemoryMax ();
842842 }
@@ -904,15 +904,15 @@ void GPUReconstruction::UpdateMaxMemoryUsed()
904904
905905void GPUReconstruction::PrintMemoryMax ()
906906{
907- printf (" Maximum Memory Allocation: Host %'ld / Device %'ld \n " , ( int64_t ) mHostMemoryUsedMax , ( int64_t ) mDeviceMemoryUsedMax );
907+ printf (" Maximum Memory Allocation: Host %'zu / Device %'zu \n " , mHostMemoryUsedMax , mDeviceMemoryUsedMax );
908908}
909909
910910void GPUReconstruction::PrintMemoryOverview ()
911911{
912912 if (mProcessingSettings .memoryAllocationStrategy == GPUMemoryResource::ALLOCATION_GLOBAL) {
913- printf (" Memory Allocation: Host %'ld / %'ld (Permanent %'ld ), Device %'ld / %'ld , (Permanent %'ld ) %d chunks\n " ,
914- ptrDiff (mHostMemoryPool , mHostMemoryBase ) + ptrDiff ((char *)mHostMemoryBase + mHostMemorySize , mHostMemoryPoolEnd ), ( int64_t ) mHostMemorySize , ptrDiff (mHostMemoryPermanent , mHostMemoryBase ),
915- ptrDiff (mDeviceMemoryPool , mDeviceMemoryBase ) + ptrDiff ((char *)mDeviceMemoryBase + mDeviceMemorySize , mDeviceMemoryPoolEnd ), ( int64_t ) mDeviceMemorySize , ptrDiff (mDeviceMemoryPermanent , mDeviceMemoryBase ), ( int32_t ) mMemoryResources .size ());
913+ printf (" Memory Allocation: Host %'zd / %'zu (Permanent %'zd ), Device %'zd / %'zu , (Permanent %'zd ) %zu chunks\n " ,
914+ ptrDiff (mHostMemoryPool , mHostMemoryBase ) + ptrDiff ((char *)mHostMemoryBase + mHostMemorySize , mHostMemoryPoolEnd ), mHostMemorySize , ptrDiff (mHostMemoryPermanent , mHostMemoryBase ),
915+ ptrDiff (mDeviceMemoryPool , mDeviceMemoryBase ) + ptrDiff ((char *)mDeviceMemoryBase + mDeviceMemorySize , mDeviceMemoryPoolEnd ), mDeviceMemorySize , ptrDiff (mDeviceMemoryPermanent , mDeviceMemoryBase ), mMemoryResources .size ());
916916 }
917917}
918918
@@ -937,7 +937,7 @@ void GPUReconstruction::PrintMemoryStatistics()
937937 }
938938 printf (" %59s CPU / %9s GPU\n " , " " , " " );
939939 for (auto it = sizes.begin (); it != sizes.end (); it++) {
940- printf (" Allocation %30s %s: Size %'14ld / %'14ld \n " , it->first .c_str (), it->second [2 ] ? " P" : " " , ( int64_t ) it->second [0 ], ( int64_t ) it->second [1 ]);
940+ printf (" Allocation %30s %s: Size %'14zu / %'14zu \n " , it->first .c_str (), it->second [2 ] ? " P" : " " , it->second [0 ], it->second [1 ]);
941941 }
942942 PrintMemoryOverview ();
943943 for (uint32_t i = 0 ; i < mChains .size (); i++) {
0 commit comments