@@ -430,6 +430,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMDeviceAlloc(
430
430
return umf2urResult (umfRet);
431
431
}
432
432
433
+ printf (" %s %d *RetMem 0x%lx\n " , __FILE__, __LINE__,
434
+ (unsigned long int )*RetMem);
435
+
433
436
if (IndirectAccessTrackingEnabled) {
434
437
// Keep track of all memory allocations in the context
435
438
Context->MemAllocs .emplace (std::piecewise_construct,
@@ -555,6 +558,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMFree(
555
558
std::scoped_lock<ur_shared_mutex> Lock (
556
559
IndirectAccessTrackingEnabled ? Plt->ContextsMutex : Context->Mutex );
557
560
561
+ printf (" %s %d\n " , __FILE__, __LINE__);
562
+
558
563
return USMFreeHelper (Context, Mem);
559
564
}
560
565
@@ -985,6 +990,7 @@ const bool UseUSMAllocator = ShouldUseUSMAllocator();
985
990
// mutex.
986
991
ur_result_t USMFreeHelper (ur_context_handle_t Context, void *Ptr,
987
992
bool OwnZeMemHandle) {
993
+ printf (" %s %d\n " , __FILE__, __LINE__);
988
994
if (!OwnZeMemHandle) {
989
995
// Memory should not be freed
990
996
return UR_RESULT_SUCCESS;
@@ -1005,16 +1011,20 @@ ur_result_t USMFreeHelper(ur_context_handle_t Context, void *Ptr,
1005
1011
Context->MemAllocs .erase (It);
1006
1012
}
1007
1013
1014
+ printf (" %s %d Ptr 0x%lx\n " , __FILE__, __LINE__, (unsigned long int )Ptr);
1015
+
1008
1016
auto hPool = umfPoolByPtr (Ptr);
1009
1017
if (!hPool) {
1010
1018
if (IndirectAccessTrackingEnabled)
1011
1019
UR_CALL (ContextReleaseHelper (Context));
1020
+ printf (" %s %d\n " , __FILE__, __LINE__);
1012
1021
return UR_RESULT_ERROR_INVALID_MEM_OBJECT;
1013
1022
}
1014
1023
1015
1024
auto umfRet = umfPoolFree (hPool, Ptr);
1016
1025
if (IndirectAccessTrackingEnabled)
1017
1026
UR_CALL (ContextReleaseHelper (Context));
1027
+ printf (" %s %d\n " , __FILE__, __LINE__);
1018
1028
return umf2urResult (umfRet);
1019
1029
}
1020
1030
0 commit comments