diff --git a/include/ur_api.h b/include/ur_api.h index aab6a9c50b..b08fac3ce9 100644 --- a/include/ur_api.h +++ b/include/ur_api.h @@ -7685,9 +7685,9 @@ urCommandBufferEnqueueExp( /// - ::UR_RESULT_ERROR_INVALID_SIZE UR_APIEXPORT ur_result_t UR_APICALL urUSMImportExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem, ///< [in] pointer to host memory object - size_t size ///< [in] size in bytes of the host memory object to be imported + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem, ///< [in] pointer to host memory object + size_t size ///< [in] size in bytes of the host memory object to be imported ); /////////////////////////////////////////////////////////////////////////////// @@ -7708,8 +7708,8 @@ urUSMImportExp( /// - ::UR_RESULT_ERROR_INVALID_CONTEXT UR_APIEXPORT ur_result_t UR_APICALL urUSMReleaseExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem ///< [in] pointer to host memory object ); #if !defined(__GNUC__) @@ -9389,8 +9389,8 @@ typedef struct ur_usm_pitched_alloc_exp_params_t { /// @details Each entry is a pointer to the parameter passed to the function; /// allowing the callback the ability to modify the parameter's value typedef struct ur_usm_import_exp_params_t { - ur_context_handle_t *phContext; - void **ppMem; + const ur_context_handle_t *phContext; + const void **ppMem; size_t *psize; } ur_usm_import_exp_params_t; @@ -9399,8 +9399,8 @@ typedef struct ur_usm_import_exp_params_t { /// @details Each entry is a pointer to the parameter passed to the function; /// allowing the callback the ability to modify the parameter's value typedef struct ur_usm_release_exp_params_t { - ur_context_handle_t *phContext; - void **ppMem; + const ur_context_handle_t *phContext; + const void **ppMem; } ur_usm_release_exp_params_t; /////////////////////////////////////////////////////////////////////////////// diff --git a/include/ur_ddi.h b/include/ur_ddi.h index 3729208835..b2ed80906f 100644 --- a/include/ur_ddi.h +++ b/include/ur_ddi.h @@ -1593,15 +1593,15 @@ typedef ur_result_t(UR_APICALL *ur_pfnUSMPitchedAllocExp_t)( /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urUSMImportExp typedef ur_result_t(UR_APICALL *ur_pfnUSMImportExp_t)( - ur_context_handle_t, - void *, + const ur_context_handle_t, + const void *, size_t); /////////////////////////////////////////////////////////////////////////////// /// @brief Function-pointer for urUSMReleaseExp typedef ur_result_t(UR_APICALL *ur_pfnUSMReleaseExp_t)( - ur_context_handle_t, - void *); + const ur_context_handle_t, + const void *); /////////////////////////////////////////////////////////////////////////////// /// @brief Table of USMExp functions pointers diff --git a/scripts/core/exp-usm-import-release.yml b/scripts/core/exp-usm-import-release.yml index 869bff64e8..0c90becd55 100644 --- a/scripts/core/exp-usm-import-release.yml +++ b/scripts/core/exp-usm-import-release.yml @@ -10,10 +10,10 @@ name: ImportExp details: - "Import memory into USM" params: - - type: $x_context_handle_t + - type: "const $x_context_handle_t" name: hContext desc: "[in] handle of the context object" - - type: "void*" + - type: "const void*" name: pMem desc: "[in] pointer to host memory object" - type: "size_t" @@ -30,10 +30,10 @@ name: ReleaseExp details: - "Release memory from USM" params: - - type: $x_context_handle_t + - type: "const $x_context_handle_t" name: hContext desc: "[in] handle of the context object" - - type: "void*" + - type: "const void*" name: pMem desc: "[in] pointer to host memory object" returns: diff --git a/source/adapters/null/ur_nullddi.cpp b/source/adapters/null/ur_nullddi.cpp index e2c4956c14..a0e486ee6f 100644 --- a/source/adapters/null/ur_nullddi.cpp +++ b/source/adapters/null/ur_nullddi.cpp @@ -4782,8 +4782,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMImportExp __urdlllocal ur_result_t UR_APICALL urUSMImportExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem, ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem, ///< [in] pointer to host memory object size_t size ///< [in] size in bytes of the host memory object to be imported ) try { ur_result_t result = UR_RESULT_SUCCESS; @@ -4804,8 +4804,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMReleaseExp __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem ///< [in] pointer to host memory object ) try { ur_result_t result = UR_RESULT_SUCCESS; diff --git a/source/loader/layers/tracing/ur_trcddi.cpp b/source/loader/layers/tracing/ur_trcddi.cpp index b66101ddc6..a0500987da 100644 --- a/source/loader/layers/tracing/ur_trcddi.cpp +++ b/source/loader/layers/tracing/ur_trcddi.cpp @@ -5524,8 +5524,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMImportExp __urdlllocal ur_result_t UR_APICALL urUSMImportExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem, ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem, ///< [in] pointer to host memory object size_t size ///< [in] size in bytes of the host memory object to be imported ) { auto pfnImportExp = context.urDdiTable.USMExp.pfnImportExp; @@ -5549,8 +5549,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMReleaseExp __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem ///< [in] pointer to host memory object ) { auto pfnReleaseExp = context.urDdiTable.USMExp.pfnReleaseExp; diff --git a/source/loader/layers/validation/ur_valddi.cpp b/source/loader/layers/validation/ur_valddi.cpp index 5f7290cb24..0c59e344f0 100644 --- a/source/loader/layers/validation/ur_valddi.cpp +++ b/source/loader/layers/validation/ur_valddi.cpp @@ -6867,8 +6867,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMImportExp __urdlllocal ur_result_t UR_APICALL urUSMImportExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem, ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem, ///< [in] pointer to host memory object size_t size ///< [in] size in bytes of the host memory object to be imported ) { auto pfnImportExp = context.urDdiTable.USMExp.pfnImportExp; @@ -6895,8 +6895,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMReleaseExp __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem ///< [in] pointer to host memory object ) { auto pfnReleaseExp = context.urDdiTable.USMExp.pfnReleaseExp; diff --git a/source/loader/ur_ldrddi.cpp b/source/loader/ur_ldrddi.cpp index 049f618703..5bdd9d5b4e 100644 --- a/source/loader/ur_ldrddi.cpp +++ b/source/loader/ur_ldrddi.cpp @@ -6658,8 +6658,8 @@ __urdlllocal ur_result_t UR_APICALL urCommandBufferEnqueueExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMImportExp __urdlllocal ur_result_t UR_APICALL urUSMImportExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem, ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem, ///< [in] pointer to host memory object size_t size ///< [in] size in bytes of the host memory object to be imported ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -6683,8 +6683,8 @@ __urdlllocal ur_result_t UR_APICALL urUSMImportExp( /////////////////////////////////////////////////////////////////////////////// /// @brief Intercept function for urUSMReleaseExp __urdlllocal ur_result_t UR_APICALL urUSMReleaseExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem ///< [in] pointer to host memory object ) { ur_result_t result = UR_RESULT_SUCCESS; diff --git a/source/loader/ur_libapi.cpp b/source/loader/ur_libapi.cpp index 238079ebe7..1b532db934 100644 --- a/source/loader/ur_libapi.cpp +++ b/source/loader/ur_libapi.cpp @@ -7201,8 +7201,8 @@ ur_result_t UR_APICALL urCommandBufferEnqueueExp( /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_SIZE ur_result_t UR_APICALL urUSMImportExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem, ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem, ///< [in] pointer to host memory object size_t size ///< [in] size in bytes of the host memory object to be imported ) try { auto pfnImportExp = ur_lib::context->urDdiTable.USMExp.pfnImportExp; @@ -7232,8 +7232,8 @@ ur_result_t UR_APICALL urUSMImportExp( /// + `NULL == pMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT ur_result_t UR_APICALL urUSMReleaseExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem ///< [in] pointer to host memory object ) try { auto pfnReleaseExp = ur_lib::context->urDdiTable.USMExp.pfnReleaseExp; if (nullptr == pfnReleaseExp) { diff --git a/source/ur_api.cpp b/source/ur_api.cpp index 4a9b80695a..ddc784faa3 100644 --- a/source/ur_api.cpp +++ b/source/ur_api.cpp @@ -6050,8 +6050,8 @@ ur_result_t UR_APICALL urCommandBufferEnqueueExp( /// - ::UR_RESULT_ERROR_INVALID_CONTEXT /// - ::UR_RESULT_ERROR_INVALID_SIZE ur_result_t UR_APICALL urUSMImportExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem, ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem, ///< [in] pointer to host memory object size_t size ///< [in] size in bytes of the host memory object to be imported ) { ur_result_t result = UR_RESULT_SUCCESS; @@ -6075,8 +6075,8 @@ ur_result_t UR_APICALL urUSMImportExp( /// + `NULL == pMem` /// - ::UR_RESULT_ERROR_INVALID_CONTEXT ur_result_t UR_APICALL urUSMReleaseExp( - ur_context_handle_t hContext, ///< [in] handle of the context object - void *pMem ///< [in] pointer to host memory object + const ur_context_handle_t hContext, ///< [in] handle of the context object + const void *pMem ///< [in] pointer to host memory object ) { ur_result_t result = UR_RESULT_SUCCESS; return result;