Skip to content

Commit 46604be

Browse files
fabiomestrekbenzie
authored andcommitted
Fix compiler error
1 parent f0fc018 commit 46604be

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

source/adapters/cuda/memory.cpp

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -473,21 +473,23 @@ UR_APIEXPORT ur_result_t UR_APICALL urMemImageGetInfo(ur_mem_handle_t hMemory,
473473
};
474474

475475
switch (propName) {
476-
case UR_IMAGE_INFO_FORMAT:
477-
ur_image_channel_type_t ChannelType;
476+
case UR_IMAGE_INFO_FORMAT: {
477+
ur_image_channel_type_t ChannelType{};
478478
UR_CHECK_ERROR(cuda2urFormat(ArrayInfo.Format, &ChannelType));
479479
return ReturnValue(
480480
ur_image_format_t{UR_IMAGE_CHANNEL_ORDER_RGBA, ChannelType});
481+
}
481482
case UR_IMAGE_INFO_WIDTH:
482483
return ReturnValue(ArrayInfo.Width);
483484
case UR_IMAGE_INFO_HEIGHT:
484485
return ReturnValue(ArrayInfo.Height);
485486
case UR_IMAGE_INFO_DEPTH:
486487
return ReturnValue(ArrayInfo.Depth);
487-
case UR_IMAGE_INFO_ELEMENT_SIZE:
488-
size_t Size;
488+
case UR_IMAGE_INFO_ELEMENT_SIZE: {
489+
size_t Size = 0;
489490
UR_CHECK_ERROR(cudaFormatToElementSize(ArrayInfo.Format, &Size));
490491
return ReturnValue(Size);
492+
}
491493
case UR_IMAGE_INFO_ROW_PITCH:
492494
case UR_IMAGE_INFO_SLICE_PITCH:
493495
return UR_RESULT_ERROR_UNSUPPORTED_ENUMERATION;

0 commit comments

Comments
 (0)