Skip to content

Commit

Permalink
Added const qualifier to some parameters.
Browse files Browse the repository at this point in the history
  • Loading branch information
rdeodhar committed Jul 7, 2023
1 parent a4bf2a5 commit 43043b7
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 41 deletions.
18 changes: 9 additions & 9 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

///////////////////////////////////////////////////////////////////////////////
Expand All @@ -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__)
Expand Down Expand Up @@ -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;

Expand All @@ -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;

///////////////////////////////////////////////////////////////////////////////
Expand Down
8 changes: 4 additions & 4 deletions include/ur_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions scripts/core/exp-usm-import-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions source/adapters/null/ur_nullddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions source/loader/layers/tracing/ur_trcddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions source/loader/layers/validation/ur_valddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions source/loader/ur_ldrddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;

Expand Down
8 changes: 4 additions & 4 deletions source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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) {
Expand Down
8 changes: 4 additions & 4 deletions source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
Expand Down

0 comments on commit 43043b7

Please sign in to comment.