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 29, 2024
1 parent f2a8155 commit ba73ba8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 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;
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
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 ba73ba8

Please sign in to comment.