Skip to content

Commit 1bdeaca

Browse files
author
Jaime Arteaga
committed
test
Signed-off-by: Jaime Arteaga <[email protected]>
1 parent 60ad384 commit 1bdeaca

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

source/adapters/level_zero/usm.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -430,6 +430,9 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMDeviceAlloc(
430430
return umf2urResult(umfRet);
431431
}
432432

433+
printf("%s %d *RetMem 0x%lx\n", __FILE__, __LINE__,
434+
(unsigned long int)*RetMem);
435+
433436
if (IndirectAccessTrackingEnabled) {
434437
// Keep track of all memory allocations in the context
435438
Context->MemAllocs.emplace(std::piecewise_construct,
@@ -555,6 +558,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urUSMFree(
555558
std::scoped_lock<ur_shared_mutex> Lock(
556559
IndirectAccessTrackingEnabled ? Plt->ContextsMutex : Context->Mutex);
557560

561+
printf("%s %d\n", __FILE__, __LINE__);
562+
558563
return USMFreeHelper(Context, Mem);
559564
}
560565

@@ -985,6 +990,7 @@ const bool UseUSMAllocator = ShouldUseUSMAllocator();
985990
// mutex.
986991
ur_result_t USMFreeHelper(ur_context_handle_t Context, void *Ptr,
987992
bool OwnZeMemHandle) {
993+
printf("%s %d\n", __FILE__, __LINE__);
988994
if (!OwnZeMemHandle) {
989995
// Memory should not be freed
990996
return UR_RESULT_SUCCESS;
@@ -1005,16 +1011,20 @@ ur_result_t USMFreeHelper(ur_context_handle_t Context, void *Ptr,
10051011
Context->MemAllocs.erase(It);
10061012
}
10071013

1014+
printf("%s %d Ptr 0x%lx\n", __FILE__, __LINE__, (unsigned long int)Ptr);
1015+
10081016
auto hPool = umfPoolByPtr(Ptr);
10091017
if (!hPool) {
10101018
if (IndirectAccessTrackingEnabled)
10111019
UR_CALL(ContextReleaseHelper(Context));
1020+
printf("%s %d\n", __FILE__, __LINE__);
10121021
return UR_RESULT_ERROR_INVALID_MEM_OBJECT;
10131022
}
10141023

10151024
auto umfRet = umfPoolFree(hPool, Ptr);
10161025
if (IndirectAccessTrackingEnabled)
10171026
UR_CALL(ContextReleaseHelper(Context));
1027+
printf("%s %d\n", __FILE__, __LINE__);
10181028
return umf2urResult(umfRet);
10191029
}
10201030

test/conformance/usm/urUSMDeviceAlloc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,8 +75,9 @@ TEST_P(urUSMDeviceAllocTest, SuccessWithDescriptors) {
7575
ASSERT_SUCCESS(urEnqueueUSMFill(queue, ptr, sizeof(pattern), &pattern,
7676
allocation_size, 0, nullptr, &event));
7777
ASSERT_SUCCESS(urEventWait(1, &event));
78-
78+
printf("%s %d\n", __FILE__, __LINE__);
7979
ASSERT_SUCCESS(urUSMFree(context, ptr));
80+
printf("%s %d\n", __FILE__, __LINE__);
8081
EXPECT_SUCCESS(urEventRelease(event));
8182
}
8283

0 commit comments

Comments
 (0)