@@ -166,41 +166,21 @@ ur_result_t ze2urImageFormat(const ze_image_format_t &ZeImageFormat,
166166 ur_image_channel_type_t ChannelType;
167167 switch (ZeImageFormat.type ) {
168168 case ZE_IMAGE_FORMAT_TYPE_UINT:
169- switch (ZeImageFormatTypeSize) {
170- case 8 :
169+ if (ZeImageFormatTypeSize == 8 ) {
171170 ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT8;
172- break ;
173- case 16 :
171+ } else if (ZeImageFormatTypeSize == 16 ) {
174172 ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16;
175- break ;
176- case 32 :
173+ } else if (ZeImageFormatTypeSize == 32 ) {
177174 ChannelType = UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32;
178- break ;
179- default :
180- UR_LOG (ERR,
181- " ze2urImageFormat: unexpected image format type size: size "
182- " = {}" ,
183- ZeImageFormatTypeSize);
184- return UR_RESULT_ERROR_INVALID_VALUE;
185175 }
186176 break ;
187177 case ZE_IMAGE_FORMAT_TYPE_SINT:
188- switch (ZeImageFormatTypeSize) {
189- case 8 :
178+ if (ZeImageFormatTypeSize == 8 ) {
190179 ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT8;
191- break ;
192- case 16 :
180+ } else if (ZeImageFormatTypeSize == 16 ) {
193181 ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT16;
194- break ;
195- case 32 :
182+ } else if (ZeImageFormatTypeSize == 32 ) {
196183 ChannelType = UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32;
197- break ;
198- default :
199- UR_LOG (ERR,
200- " ze2urImageFormat: unexpected image format type size: size "
201- " = {}" ,
202- ZeImageFormatTypeSize);
203- return UR_RESULT_ERROR_INVALID_VALUE;
204184 }
205185 break ;
206186 case ZE_IMAGE_FORMAT_TYPE_UNORM:
0 commit comments