Skip to content

Commit

Permalink
Clarify the behaviour of urUSMMemAdvise and urUSMPrefetch when the hi…
Browse files Browse the repository at this point in the history
…nt is unsupported (#854)
  • Loading branch information
fabiomestre committed Sep 14, 2023
1 parent db69f90 commit fdffac3
Show file tree
Hide file tree
Showing 4 changed files with 37 additions and 1 deletion.
10 changes: 10 additions & 0 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -6627,6 +6627,11 @@ urEnqueueUSMMemcpy(
///////////////////////////////////////////////////////////////////////////////
/// @brief Enqueue a command to prefetch USM memory
///
/// @details
/// - Prefetching may not be supported for all devices or allocation types.
/// If memory prefetching is not supported, the prefetch hint will be
/// ignored.
///
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_UNINITIALIZED
Expand Down Expand Up @@ -6668,6 +6673,11 @@ urEnqueueUSMPrefetch(
///////////////////////////////////////////////////////////////////////////////
/// @brief Enqueue a command to set USM memory advice
///
/// @details
/// - Not all memory advice hints may be supported for all devices or
/// allocation types. If a memory advice hint is not supported, it will be
/// ignored.
///
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_UNINITIALIZED
Expand Down
8 changes: 7 additions & 1 deletion scripts/core/enqueue.yml
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,9 @@ desc: "Enqueue a command to prefetch USM memory"
class: $xEnqueue
name: USMPrefetch
ordinal: "0"
details:
- "Prefetching may not be supported for all devices or allocation types. If memory prefetching
is not supported, the prefetch hint will be ignored."
params:
- type: $x_queue_handle_t
name: hQueue
Expand Down Expand Up @@ -1128,10 +1131,13 @@ returns:
- $X_RESULT_ERROR_OUT_OF_RESOURCES
--- #--------------------------------------------------------------------------
type: function
desc: "Enqueue a command to set USM memory advice"
desc: "Enqueue a command to set USM memory advice"
class: $xEnqueue
name: USMAdvise
ordinal: "0"
details:
- "Not all memory advice hints may be supported for all devices or allocation types.
If a memory advice hint is not supported, it will be ignored."
params:
- type: $x_queue_handle_t
name: hQueue
Expand Down
10 changes: 10 additions & 0 deletions source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5685,6 +5685,11 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy(
///////////////////////////////////////////////////////////////////////////////
/// @brief Enqueue a command to prefetch USM memory
///
/// @details
/// - Prefetching may not be supported for all devices or allocation types.
/// If memory prefetching is not supported, the prefetch hint will be
/// ignored.
///
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_UNINITIALIZED
Expand Down Expand Up @@ -5737,6 +5742,11 @@ ur_result_t UR_APICALL urEnqueueUSMPrefetch(
///////////////////////////////////////////////////////////////////////////////
/// @brief Enqueue a command to set USM memory advice
///
/// @details
/// - Not all memory advice hints may be supported for all devices or
/// allocation types. If a memory advice hint is not supported, it will be
/// ignored.
///
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_UNINITIALIZED
Expand Down
10 changes: 10 additions & 0 deletions source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4830,6 +4830,11 @@ ur_result_t UR_APICALL urEnqueueUSMMemcpy(
///////////////////////////////////////////////////////////////////////////////
/// @brief Enqueue a command to prefetch USM memory
///
/// @details
/// - Prefetching may not be supported for all devices or allocation types.
/// If memory prefetching is not supported, the prefetch hint will be
/// ignored.
///
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_UNINITIALIZED
Expand Down Expand Up @@ -4875,6 +4880,11 @@ ur_result_t UR_APICALL urEnqueueUSMPrefetch(
///////////////////////////////////////////////////////////////////////////////
/// @brief Enqueue a command to set USM memory advice
///
/// @details
/// - Not all memory advice hints may be supported for all devices or
/// allocation types. If a memory advice hint is not supported, it will be
/// ignored.
///
/// @returns
/// - ::UR_RESULT_SUCCESS
/// - ::UR_RESULT_ERROR_UNINITIALIZED
Expand Down

0 comments on commit fdffac3

Please sign in to comment.