Skip to content

Commit

Permalink
[HIP] Add support for querying USM allocation size
Browse files Browse the repository at this point in the history
  • Loading branch information
frasercrmck committed May 30, 2024
1 parent e16d01c commit 90cee31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 4 deletions.
6 changes: 5 additions & 1 deletion source/adapters/hip/usm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,12 @@ urUSMGetMemAllocInfo(ur_context_handle_t hContext, const void *pMem,
}
return ReturnValue(Pool);
}
case UR_USM_ALLOC_INFO_SIZE: {
size_t RangeSize = 0;
UR_CHECK_ERROR(hipMemPtrGetInfo(const_cast<void *>(pMem), &RangeSize));
return ReturnValue(RangeSize);
}
case UR_USM_ALLOC_INFO_BASE_PTR:
case UR_USM_ALLOC_INFO_SIZE:
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;
default:
return UR_RESULT_ERROR_INVALID_ENUMERATION;
Expand Down
2 changes: 0 additions & 2 deletions test/conformance/enqueue/enqueue_adapter_hip.match
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,9 @@ urEnqueueMemImageReadTest.Success1D/AMD_HIP_BACKEND___{{.*}}_
urEnqueueMemImageReadTest.Success3D/AMD_HIP_BACKEND___{{.*}}_
urEnqueueMemImageWriteTest.Success1D/AMD_HIP_BACKEND___{{.*}}_
urEnqueueMemImageWriteTest.Success3D/AMD_HIP_BACKEND___{{.*}}_
{{OPT}}urEnqueueUSMFill2DNegativeTest.OutOfBounds/AMD_HIP_BACKEND___{{.*}}_
urEnqueueUSMAdviseWithParamTest.Success/AMD_HIP_BACKEND___{{.*}}___UR_USM_ADVICE_FLAG_DEFAULT
urEnqueueUSMAdviseTest.MultipleParamsSuccess/AMD_HIP_BACKEND___{{.*}}_
urEnqueueUSMAdviseTest.NonCoherentDeviceMemorySuccessOrWarning/AMD_HIP_BACKEND___{{.*}}_
urEnqueueUSMMemcpy2DNegativeTest.InvalidSize/AMD_HIP_BACKEND___{{.*}}___pitch__1__width__1__height__1__src__UR_USM_TYPE_DEVICE__dst__UR_USM_TYPE_DEVICE
urEnqueueUSMPrefetchWithParamTest.Success/AMD_HIP_BACKEND___{{.*}}___UR_USM_MIGRATION_FLAG_DEFAULT
urEnqueueUSMPrefetchWithParamTest.CheckWaitEvent/AMD_HIP_BACKEND___{{.*}}___UR_USM_MIGRATION_FLAG_DEFAULT
urEnqueueTimestampRecordingExpTest.Success/AMD_HIP_BACKEND___{{.*}}
Expand Down
1 change: 0 additions & 1 deletion test/conformance/usm/usm_adapter_hip.match
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/AMD_HIP_BACKEND___{{.*}}
urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/AMD_HIP_BACKEND___{{.*}}___UsePoolEnabled_64_512
urUSMDeviceAllocAlignmentTest.SuccessAlignedAllocations/AMD_HIP_BACKEND___{{.*}}___UsePoolEnabled_64_2048
urUSMGetMemAllocInfoTest.Success/AMD_HIP_BACKEND___{{.*}}___UR_USM_ALLOC_INFO_BASE_PTR
urUSMGetMemAllocInfoTest.Success/AMD_HIP_BACKEND___{{.*}}___UR_USM_ALLOC_INFO_SIZE
urUSMGetMemAllocInfoTest.Success/AMD_HIP_BACKEND___{{.*}}___UR_USM_ALLOC_INFO_POOL
urUSMHostAllocTest.Success/AMD_HIP_BACKEND___{{.*}}___UsePoolEnabled
urUSMHostAllocTest.SuccessWithDescriptors/AMD_HIP_BACKEND___{{.*}}___UsePoolEnabled
Expand Down

0 comments on commit 90cee31

Please sign in to comment.