@@ -209,6 +209,8 @@ typedef enum ur_function_t {
209
209
UR_FUNCTION_COMMAND_BUFFER_APPEND_MEM_BUFFER_FILL_EXP = 192, ///< Enumerator for ::urCommandBufferAppendMemBufferFillExp
210
210
UR_FUNCTION_ENQUEUE_COOPERATIVE_KERNEL_LAUNCH_EXP = 193, ///< Enumerator for ::urEnqueueCooperativeKernelLaunchExp
211
211
UR_FUNCTION_KERNEL_SUGGEST_MAX_COOPERATIVE_GROUP_COUNT_EXP = 194, ///< Enumerator for ::urKernelSuggestMaxCooperativeGroupCountExp
212
+ UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_PREFETCH_EXP = 195, ///< Enumerator for ::urCommandBufferAppendUSMPrefetchExp
213
+ UR_FUNCTION_COMMAND_BUFFER_APPEND_USM_ADVISE_EXP = 196, ///< Enumerator for ::urCommandBufferAppendUSMAdviseExp
212
214
/// @cond
213
215
UR_FUNCTION_FORCE_UINT32 = 0x7fffffff
214
216
/// @endcond
@@ -8159,6 +8161,88 @@ urCommandBufferAppendMemBufferFillExp(
8159
8161
ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
8160
8162
);
8161
8163
8164
+ ///////////////////////////////////////////////////////////////////////////////
8165
+ /// @brief Append a USM Prefetch command to a command-buffer object
8166
+ ///
8167
+ /// @details
8168
+ /// - Prefetching may not be supported for all devices or allocation types.
8169
+ /// If memory prefetching is not supported, the prefetch hint will be
8170
+ /// ignored.
8171
+ ///
8172
+ /// @returns
8173
+ /// - ::UR_RESULT_SUCCESS
8174
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
8175
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
8176
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
8177
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
8178
+ /// + `NULL == hCommandBuffer`
8179
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
8180
+ /// + `NULL == pMemory`
8181
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
8182
+ /// + `::UR_USM_MIGRATION_FLAGS_MASK & flags`
8183
+ /// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
8184
+ /// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
8185
+ /// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP
8186
+ /// + `pSyncPointWaitList == NULL && numSyncPointsInWaitList > 0`
8187
+ /// + `pSyncPointWaitList != NULL && numSyncPointsInWaitList == 0`
8188
+ /// - ::UR_RESULT_ERROR_INVALID_MEM_OBJECT
8189
+ /// - ::UR_RESULT_ERROR_INVALID_SIZE
8190
+ /// + `size == 0`
8191
+ /// + If `size` is higher than the allocation size of `pMemory`
8192
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
8193
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
8194
+ UR_APIEXPORT ur_result_t UR_APICALL
8195
+ urCommandBufferAppendUSMPrefetchExp(
8196
+ ur_exp_command_buffer_handle_t hCommandBuffer, ///< [in] handle of the command-buffer object.
8197
+ const void *pMemory, ///< [in] pointer to USM allocated memory to prefetch.
8198
+ size_t size, ///< [in] size in bytes to be fetched.
8199
+ ur_usm_migration_flags_t flags, ///< [in] USM prefetch flags
8200
+ uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8201
+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8202
+ ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
8203
+ );
8204
+
8205
+ ///////////////////////////////////////////////////////////////////////////////
8206
+ /// @brief Append a USM Advise command to a command-buffer object
8207
+ ///
8208
+ /// @details
8209
+ /// - Not all memory advice hints may be supported for all devices or
8210
+ /// allocation types. If a memory advice hint is not supported, it will be
8211
+ /// ignored.
8212
+ ///
8213
+ /// @returns
8214
+ /// - ::UR_RESULT_SUCCESS
8215
+ /// - ::UR_RESULT_ERROR_UNINITIALIZED
8216
+ /// - ::UR_RESULT_ERROR_DEVICE_LOST
8217
+ /// - ::UR_RESULT_ERROR_ADAPTER_SPECIFIC
8218
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_HANDLE
8219
+ /// + `NULL == hCommandBuffer`
8220
+ /// - ::UR_RESULT_ERROR_INVALID_NULL_POINTER
8221
+ /// + `NULL == pMemory`
8222
+ /// - ::UR_RESULT_ERROR_INVALID_ENUMERATION
8223
+ /// + `::UR_USM_ADVICE_FLAGS_MASK & advice`
8224
+ /// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_EXP
8225
+ /// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_EXP
8226
+ /// - ::UR_RESULT_ERROR_INVALID_COMMAND_BUFFER_SYNC_POINT_WAIT_LIST_EXP
8227
+ /// + `pSyncPointWaitList == NULL && numSyncPointsInWaitList > 0`
8228
+ /// + `pSyncPointWaitList != NULL && numSyncPointsInWaitList == 0`
8229
+ /// - ::UR_RESULT_ERROR_INVALID_MEM_OBJECT
8230
+ /// - ::UR_RESULT_ERROR_INVALID_SIZE
8231
+ /// + `size == 0`
8232
+ /// + If `size` is higher than the allocation size of `pMemory`
8233
+ /// - ::UR_RESULT_ERROR_OUT_OF_HOST_MEMORY
8234
+ /// - ::UR_RESULT_ERROR_OUT_OF_RESOURCES
8235
+ UR_APIEXPORT ur_result_t UR_APICALL
8236
+ urCommandBufferAppendUSMAdviseExp(
8237
+ ur_exp_command_buffer_handle_t hCommandBuffer, ///< [in] handle of the command-buffer object.
8238
+ const void *pMemory, ///< [in] pointer to the USM memory object.
8239
+ size_t size, ///< [in] size in bytes to be advised.
8240
+ ur_usm_advice_flags_t advice, ///< [in] USM memory advice
8241
+ uint32_t numSyncPointsInWaitList, ///< [in] The number of sync points in the provided dependency list.
8242
+ const ur_exp_command_buffer_sync_point_t *pSyncPointWaitList, ///< [in][optional] A list of sync points that this command depends on.
8243
+ ur_exp_command_buffer_sync_point_t *pSyncPoint ///< [out][optional] sync point associated with this command.
8244
+ );
8245
+
8162
8246
///////////////////////////////////////////////////////////////////////////////
8163
8247
/// @brief Submit a command-buffer for execution on a queue.
8164
8248
///
@@ -10332,6 +10416,34 @@ typedef struct ur_command_buffer_append_mem_buffer_fill_exp_params_t {
10332
10416
ur_exp_command_buffer_sync_point_t **ppSyncPoint;
10333
10417
} ur_command_buffer_append_mem_buffer_fill_exp_params_t;
10334
10418
10419
+ ///////////////////////////////////////////////////////////////////////////////
10420
+ /// @brief Function parameters for urCommandBufferAppendUSMPrefetchExp
10421
+ /// @details Each entry is a pointer to the parameter passed to the function;
10422
+ /// allowing the callback the ability to modify the parameter's value
10423
+ typedef struct ur_command_buffer_append_usm_prefetch_exp_params_t {
10424
+ ur_exp_command_buffer_handle_t *phCommandBuffer;
10425
+ const void **ppMemory;
10426
+ size_t *psize;
10427
+ ur_usm_migration_flags_t *pflags;
10428
+ uint32_t *pnumSyncPointsInWaitList;
10429
+ const ur_exp_command_buffer_sync_point_t **ppSyncPointWaitList;
10430
+ ur_exp_command_buffer_sync_point_t **ppSyncPoint;
10431
+ } ur_command_buffer_append_usm_prefetch_exp_params_t;
10432
+
10433
+ ///////////////////////////////////////////////////////////////////////////////
10434
+ /// @brief Function parameters for urCommandBufferAppendUSMAdviseExp
10435
+ /// @details Each entry is a pointer to the parameter passed to the function;
10436
+ /// allowing the callback the ability to modify the parameter's value
10437
+ typedef struct ur_command_buffer_append_usm_advise_exp_params_t {
10438
+ ur_exp_command_buffer_handle_t *phCommandBuffer;
10439
+ const void **ppMemory;
10440
+ size_t *psize;
10441
+ ur_usm_advice_flags_t *padvice;
10442
+ uint32_t *pnumSyncPointsInWaitList;
10443
+ const ur_exp_command_buffer_sync_point_t **ppSyncPointWaitList;
10444
+ ur_exp_command_buffer_sync_point_t **ppSyncPoint;
10445
+ } ur_command_buffer_append_usm_advise_exp_params_t;
10446
+
10335
10447
///////////////////////////////////////////////////////////////////////////////
10336
10448
/// @brief Function parameters for urCommandBufferEnqueueExp
10337
10449
/// @details Each entry is a pointer to the parameter passed to the function;
0 commit comments