Skip to content

Commit d1a3525

Browse files
committed
[UR] Fix warnings in appendKernelLaunchWithArgsExpNew()
Fix following warnings in appendKernelLaunchWithArgsExpNew(): warning: cast from type ‘X’ to type ‘void*’ casts away qualifiers [-Wcast-qual] Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
1 parent af42705 commit d1a3525

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

unified-runtime/source/adapters/level_zero/v2/command_list_manager.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1171,13 +1171,16 @@ ur_result_t ur_command_list_manager::appendKernelLaunchWithArgsExpNew(
11711171
for (uint32_t argIndex = 0; argIndex < numArgs; argIndex++) {
11721172
switch (pArgs[argIndex].type) {
11731173
case UR_EXP_KERNEL_ARG_TYPE_LOCAL:
1174-
hKernel->kernelArgs[argIndex] = (void *)&pArgs[argIndex].size;
1174+
hKernel->kernelArgs[argIndex] =
1175+
reinterpret_cast<void *>(const_cast<size_t *>(&pArgs[argIndex].size));
11751176
break;
11761177
case UR_EXP_KERNEL_ARG_TYPE_VALUE:
1177-
hKernel->kernelArgs[argIndex] = (void *)pArgs[argIndex].value.value;
1178+
hKernel->kernelArgs[argIndex] =
1179+
const_cast<void *>(pArgs[argIndex].value.value);
11781180
break;
11791181
case UR_EXP_KERNEL_ARG_TYPE_POINTER:
1180-
hKernel->kernelArgs[argIndex] = (void *)&pArgs[argIndex].value.pointer;
1182+
hKernel->kernelArgs[argIndex] = reinterpret_cast<void *>(
1183+
const_cast<void **>(&pArgs[argIndex].value.pointer));
11811184
break;
11821185
case UR_EXP_KERNEL_ARG_TYPE_MEM_OBJ:
11831186
// compute zePtr for the given memory handle and store it in

0 commit comments

Comments
 (0)