Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Exp] Added const qualifier to some parameters. #699

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions include/ur_api.h
Original file line number Diff line number Diff line change
Expand Up @@ -7686,7 +7686,7 @@ urCommandBufferEnqueueExp(
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
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 @@ -7709,7 +7709,7 @@ urUSMImportExp(
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 void *pMem ///< [in] pointer to host memory object
);

#if !defined(__GNUC__)
Expand Down Expand Up @@ -9390,7 +9390,7 @@ typedef struct ur_usm_pitched_alloc_exp_params_t {
/// 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 void **ppMem;
size_t *psize;
} ur_usm_import_exp_params_t;

Expand All @@ -9400,7 +9400,7 @@ typedef struct ur_usm_import_exp_params_t {
/// 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 void **ppMem;
} ur_usm_release_exp_params_t;

///////////////////////////////////////////////////////////////////////////////
Expand Down
4 changes: 2 additions & 2 deletions include/ur_ddi.h
Original file line number Diff line number Diff line change
Expand Up @@ -1594,14 +1594,14 @@ 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 void *,
size_t);

///////////////////////////////////////////////////////////////////////////////
/// @brief Function-pointer for urUSMReleaseExp
typedef ur_result_t(UR_APICALL *ur_pfnUSMReleaseExp_t)(
ur_context_handle_t,
void *);
const void *);

///////////////////////////////////////////////////////////////////////////////
/// @brief Table of USMExp functions pointers
Expand Down
4 changes: 2 additions & 2 deletions scripts/core/exp-usm-import-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ params:
- type: $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 @@ -33,7 +33,7 @@ params:
- type: $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
4 changes: 2 additions & 2 deletions source/adapters/null/ur_nullddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4783,7 +4783,7 @@ __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 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 @@ -4805,7 +4805,7 @@ __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 void *pMem ///< [in] pointer to host memory object
) try {
ur_result_t result = UR_RESULT_SUCCESS;

Expand Down
4 changes: 2 additions & 2 deletions source/loader/layers/tracing/ur_trcddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5525,7 +5525,7 @@ __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 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 @@ -5550,7 +5550,7 @@ __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 void *pMem ///< [in] pointer to host memory object
) {
auto pfnReleaseExp = context.urDdiTable.USMExp.pfnReleaseExp;

Expand Down
4 changes: 2 additions & 2 deletions source/loader/layers/validation/ur_valddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6868,7 +6868,7 @@ __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 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 Down Expand Up @@ -6896,7 +6896,7 @@ __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 void *pMem ///< [in] pointer to host memory object
) {
auto pfnReleaseExp = context.urDdiTable.USMExp.pfnReleaseExp;

Expand Down
4 changes: 2 additions & 2 deletions source/loader/ur_ldrddi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6659,7 +6659,7 @@ __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 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 @@ -6684,7 +6684,7 @@ __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 void *pMem ///< [in] pointer to host memory object
) {
ur_result_t result = UR_RESULT_SUCCESS;

Expand Down
4 changes: 2 additions & 2 deletions source/loader/ur_libapi.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7202,7 +7202,7 @@ ur_result_t UR_APICALL urCommandBufferEnqueueExp(
/// - ::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 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 @@ -7233,7 +7233,7 @@ ur_result_t UR_APICALL urUSMImportExp(
/// - ::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 void *pMem ///< [in] pointer to host memory object
) try {
auto pfnReleaseExp = ur_lib::context->urDdiTable.USMExp.pfnReleaseExp;
if (nullptr == pfnReleaseExp) {
Expand Down
4 changes: 2 additions & 2 deletions source/ur_api.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -6051,7 +6051,7 @@ ur_result_t UR_APICALL urCommandBufferEnqueueExp(
/// - ::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 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 @@ -6076,7 +6076,7 @@ ur_result_t UR_APICALL urUSMImportExp(
/// - ::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 void *pMem ///< [in] pointer to host memory object
) {
ur_result_t result = UR_RESULT_SUCCESS;
return result;
Expand Down