@@ -357,7 +357,6 @@ ur_result_t ur2zeImageDesc(const ur_image_format_t *ImageFormat,
357
357
358
358
ZeImageDesc.stype = ZE_STRUCTURE_TYPE_IMAGE_DESC;
359
359
ZeImageDesc.pNext = ImageDesc->pNext ;
360
- ZeImageDesc.arraylevels = ZeImageDesc.flags = 0 ;
361
360
ZeImageDesc.type = ZeImageType;
362
361
ZeImageDesc.format = ZeFormatDesc;
363
362
ZeImageDesc.width = ur_cast<uint64_t >(ImageDesc->width );
@@ -416,9 +415,9 @@ uint32_t getPixelSizeBytes(const ur_image_format_t *Format) {
416
415
case UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT16:
417
416
case UR_IMAGE_CHANNEL_TYPE_UNORM_SHORT_565:
418
417
case UR_IMAGE_CHANNEL_TYPE_UNORM_SHORT_555:
418
+ case UR_IMAGE_CHANNEL_TYPE_HALF_FLOAT:
419
419
ChannelTypeSizeInBytes = 2 ;
420
420
break ;
421
- case UR_IMAGE_CHANNEL_TYPE_HALF_FLOAT:
422
421
case UR_IMAGE_CHANNEL_TYPE_INT_101010:
423
422
case UR_IMAGE_CHANNEL_TYPE_SIGNED_INT32:
424
423
case UR_IMAGE_CHANNEL_TYPE_UNSIGNED_INT32:
@@ -441,11 +440,12 @@ ur_result_t getImageRegionHelper(ze_image_desc_t ZeImageDesc,
441
440
UR_ASSERT (Origin, UR_RESULT_ERROR_INVALID_VALUE);
442
441
UR_ASSERT (Region, UR_RESULT_ERROR_INVALID_VALUE);
443
442
444
- if (ZeImageDesc.type == ZE_IMAGE_TYPE_1D) {
443
+ if (ZeImageDesc.type == ZE_IMAGE_TYPE_1D ||
444
+ ZeImageDesc.type == ZE_IMAGE_TYPE_1DARRAY) {
445
445
Region->height = 1 ;
446
446
Region->depth = 1 ;
447
447
} else if (ZeImageDesc.type == ZE_IMAGE_TYPE_2D ||
448
- ZeImageDesc.type == ZE_IMAGE_TYPE_1DARRAY ) {
448
+ ZeImageDesc.type == ZE_IMAGE_TYPE_2DARRAY ) {
449
449
Region->depth = 1 ;
450
450
}
451
451
@@ -454,6 +454,7 @@ ur_result_t getImageRegionHelper(ze_image_desc_t ZeImageDesc,
454
454
Origin->z == 0 ) ||
455
455
(ZeImageDesc.type == ZE_IMAGE_TYPE_1DARRAY && Origin->z == 0 ) ||
456
456
(ZeImageDesc.type == ZE_IMAGE_TYPE_2D && Origin->z == 0 ) ||
457
+ (ZeImageDesc.type == ZE_IMAGE_TYPE_2DARRAY) ||
457
458
(ZeImageDesc.type == ZE_IMAGE_TYPE_3D),
458
459
UR_RESULT_ERROR_INVALID_VALUE);
459
460
@@ -464,6 +465,7 @@ ur_result_t getImageRegionHelper(ze_image_desc_t ZeImageDesc,
464
465
Region->depth == 1 ) ||
465
466
(ZeImageDesc.type == ZE_IMAGE_TYPE_1DARRAY && Region->depth == 1 ) ||
466
467
(ZeImageDesc.type == ZE_IMAGE_TYPE_2D && Region->depth == 1 ) ||
468
+ (ZeImageDesc.type == ZE_IMAGE_TYPE_2DARRAY) ||
467
469
(ZeImageDesc.type == ZE_IMAGE_TYPE_3D),
468
470
UR_RESULT_ERROR_INVALID_VALUE);
469
471
#endif // !NDEBUG
@@ -473,8 +475,12 @@ ur_result_t getImageRegionHelper(ze_image_desc_t ZeImageDesc,
473
475
uint32_t OriginZ = ur_cast<uint32_t >(Origin->z );
474
476
475
477
uint32_t Width = ur_cast<uint32_t >(Region->width );
476
- uint32_t Height = ur_cast<uint32_t >(Region->height );
477
- uint32_t Depth = ur_cast<uint32_t >(Region->depth );
478
+ uint32_t Height = (ZeImageDesc.type == ZE_IMAGE_TYPE_1DARRAY)
479
+ ? ZeImageDesc.arraylevels
480
+ : ur_cast<uint32_t >(Region->height );
481
+ uint32_t Depth = (ZeImageDesc.type == ZE_IMAGE_TYPE_2DARRAY)
482
+ ? ZeImageDesc.arraylevels
483
+ : ur_cast<uint32_t >(Region->depth );
478
484
479
485
ZeRegion = {OriginX, OriginY, OriginZ, Width, Height, Depth};
480
486
@@ -693,7 +699,8 @@ UR_APIEXPORT ur_result_t UR_APICALL urBindlessImagesUnsampledImageCreateExp(
693
699
ZeImage = UrImage->ZeImage ;
694
700
*phMem = nullptr ;
695
701
}
696
- } else if (MemAllocProperties.type == ZE_MEMORY_TYPE_DEVICE) {
702
+ } else if (MemAllocProperties.type == ZE_MEMORY_TYPE_DEVICE ||
703
+ MemAllocProperties.type == ZE_MEMORY_TYPE_SHARED) {
697
704
ze_image_pitched_exp_desc_t PitchedDesc;
698
705
PitchedDesc.stype = ZE_STRUCTURE_TYPE_PITCHED_IMAGE_EXP_DESC;
699
706
PitchedDesc.pNext = nullptr ;
0 commit comments