Skip to content

Fix error returns of urUSMHostAlloc #2556

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jan 14, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -3554,10 +3554,10 @@ typedef struct ur_usm_pool_limits_desc_t {
/// + If ::UR_DEVICE_INFO_USM_HOST_SUPPORT is false.
/// - ::UR_RESULT_ERROR_INVALID_VALUE
/// + `pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`
/// + If `align` is greater that the size of the largest data type supported by `hDevice`.
/// + If `align` is greater that the size of the largest data type supported by any device in `hContext`.
/// - ::UR_RESULT_ERROR_INVALID_USM_SIZE
/// + `size == 0`
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
Expand Down
4 changes: 2 additions & 2 deletions scripts/core/usm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -257,10 +257,10 @@ returns:
- "If $X_DEVICE_INFO_USM_HOST_SUPPORT is false."
- $X_RESULT_ERROR_INVALID_VALUE:
- "`pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`" # alignment must be power of two
- "If `align` is greater that the size of the largest data type supported by `hDevice`."
- "If `align` is greater that the size of the largest data type supported by any device in `hContext`."
- $X_RESULT_ERROR_INVALID_USM_SIZE:
- "`size == 0`"
- "`size` is greater than $X_DEVICE_INFO_MAX_MEM_ALLOC_SIZE."
- "`size` is greater than $X_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`"
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
- $X_RESULT_ERROR_OUT_OF_RESOURCES
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:
Expand Down
2 changes: 1 addition & 1 deletion scripts/templates/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1130,7 +1130,7 @@ def make_param_checks(namespace, tags, obj, cpp=False, meta=None):
for key, values in item.items():
key = subt(namespace, tags, key, False, cpp)
for val in values:
code = re.match(r"^\`(.*)\`$", val)
code = re.match(r"^\`([^`]*)\`$", val)
if code:
if key not in checks:
checks[key] = []
Expand Down
4 changes: 2 additions & 2 deletions source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2252,10 +2252,10 @@ ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
/// + If ::UR_DEVICE_INFO_USM_HOST_SUPPORT is false.
/// - ::UR_RESULT_ERROR_INVALID_VALUE
/// + `pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`
/// + If `align` is greater that the size of the largest data type supported by `hDevice`.
/// + If `align` is greater that the size of the largest data type supported by any device in `hContext`.
/// - ::UR_RESULT_ERROR_INVALID_USM_SIZE
/// + `size == 0`
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
Expand Down
4 changes: 2 additions & 2 deletions source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1946,10 +1946,10 @@ ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
/// + If ::UR_DEVICE_INFO_USM_HOST_SUPPORT is false.
/// - ::UR_RESULT_ERROR_INVALID_VALUE
/// + `pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`
/// + If `align` is greater that the size of the largest data type supported by `hDevice`.
/// + If `align` is greater that the size of the largest data type supported by any device in `hContext`.
/// - ::UR_RESULT_ERROR_INVALID_USM_SIZE
/// + `size == 0`
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE
Expand Down
Loading