Skip to content

Commit d1c25f1

Browse files
committed
Fix error returns of urUSMHostAlloc
This previously referenced a nonexistent `hDevice` parameter. It has been updated to match the OpenCL function. Also, the validation layer generator logic has been updated to handle conditions that contain "`", which was an edge case that wasn't handled before.
1 parent ad88f0a commit d1c25f1

File tree

5 files changed

+9
-9
lines changed

5 files changed

+9
-9
lines changed

include/ur_api.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3554,10 +3554,10 @@ typedef struct ur_usm_pool_limits_desc_t {
35543554
/// + If ::UR_DEVICE_INFO_USM_HOST_SUPPORT is false.
35553555
/// - ::UR_RESULT_ERROR_INVALID_VALUE
35563556
/// + `pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`
3557-
/// + If `align` is greater that the size of the largest data type supported by `hDevice`.
3557+
/// + If `align` is greater that the size of the largest data type supported by any device in `hContext`.
35583558
/// - ::UR_RESULT_ERROR_INVALID_USM_SIZE
35593559
/// + `size == 0`
3560-
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
3560+
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`
35613561
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
35623562
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
35633563
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE

scripts/core/usm.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,10 +257,10 @@ returns:
257257
- "If $X_DEVICE_INFO_USM_HOST_SUPPORT is false."
258258
- $X_RESULT_ERROR_INVALID_VALUE:
259259
- "`pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`" # alignment must be power of two
260-
- "If `align` is greater that the size of the largest data type supported by `hDevice`."
260+
- "If `align` is greater that the size of the largest data type supported by any device in `hContext`."
261261
- $X_RESULT_ERROR_INVALID_USM_SIZE:
262262
- "`size == 0`"
263-
- "`size` is greater than $X_DEVICE_INFO_MAX_MEM_ALLOC_SIZE."
263+
- "`size` is greater than $X_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`"
264264
- $X_RESULT_ERROR_OUT_OF_HOST_MEMORY
265265
- $X_RESULT_ERROR_OUT_OF_RESOURCES
266266
- $X_RESULT_ERROR_UNSUPPORTED_FEATURE:

scripts/templates/helper.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1130,7 +1130,7 @@ def make_param_checks(namespace, tags, obj, cpp=False, meta=None):
11301130
for key, values in item.items():
11311131
key = subt(namespace, tags, key, False, cpp)
11321132
for val in values:
1133-
code = re.match(r"^\`(.*)\`$", val)
1133+
code = re.match(r"^\`([^`]*)\`$", val)
11341134
if code:
11351135
if key not in checks:
11361136
checks[key] = []

source/loader/ur_libapi.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2252,10 +2252,10 @@ ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
22522252
/// + If ::UR_DEVICE_INFO_USM_HOST_SUPPORT is false.
22532253
/// - ::UR_RESULT_ERROR_INVALID_VALUE
22542254
/// + `pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`
2255-
/// + If `align` is greater that the size of the largest data type supported by `hDevice`.
2255+
/// + If `align` is greater that the size of the largest data type supported by any device in `hContext`.
22562256
/// - ::UR_RESULT_ERROR_INVALID_USM_SIZE
22572257
/// + `size == 0`
2258-
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
2258+
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`
22592259
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
22602260
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
22612261
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE

source/ur_api.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1946,10 +1946,10 @@ ur_result_t UR_APICALL urSamplerCreateWithNativeHandle(
19461946
/// + If ::UR_DEVICE_INFO_USM_HOST_SUPPORT is false.
19471947
/// - ::UR_RESULT_ERROR_INVALID_VALUE
19481948
/// + `pUSMDesc && pUSMDesc->align != 0 && ((pUSMDesc->align & (pUSMDesc->align-1)) != 0)`
1949-
/// + If `align` is greater that the size of the largest data type supported by `hDevice`.
1949+
/// + If `align` is greater that the size of the largest data type supported by any device in `hContext`.
19501950
/// - ::UR_RESULT_ERROR_INVALID_USM_SIZE
19511951
/// + `size == 0`
1952-
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE.
1952+
/// + `size` is greater than ::UR_DEVICE_INFO_MAX_MEM_ALLOC_SIZE for any device in `hContext`
19531953
/// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
19541954
/// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
19551955
/// - ::UR_RESULT_ERROR_UNSUPPORTED_FEATURE

0 commit comments

Comments
 (0)