Skip to content

Commit f25e8be

Browse files
committed
[SYCL][E2E][Bindless] Add 3-channel unorm_int8 and half vulkan-interop subtests
1 parent 3524739 commit f25e8be

File tree

4 files changed

+23
-0
lines changed

4 files changed

+23
-0
lines changed

sycl/test-e2e/bindless_images/helpers/common.hpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,8 @@ constexpr sycl::vec<DType, NChannel> init_vector(DType val) {
8282
return sycl::vec<DType, NChannel>{val};
8383
} else if constexpr (NChannel == 2) {
8484
return sycl::vec<DType, NChannel>{val, val};
85+
} else if constexpr (NChannel == 3) {
86+
return sycl::vec<DType, NChannel>{val, val, val};
8587
} else if constexpr (NChannel == 4) {
8688
return sycl::vec<DType, NChannel>{val, val, val, val};
8789
} else {

sycl/test-e2e/bindless_images/vulkan_interop/sampled_images.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -483,6 +483,12 @@ bool run_tests() {
483483
valid &= run_test<2, sycl::half, 2, sycl::image_channel_type::fp16,
484484
sycl::image_channel_order::rg, class fp16_2d_c2>(
485485
{1920, 1080}, {16, 8}, 0);
486+
valid &= run_test<2, sycl::half, 3, sycl::image_channel_type::fp16,
487+
sycl::image_channel_order::rgb, class fp16_2d_c3>(
488+
{2048, 2048}, {16, 16}, 0);
489+
valid &= run_test<2, uint8_t, 3, sycl::image_channel_type::unorm_int8,
490+
sycl::image_channel_order::rgb, class unorm_int8_2d_c3>(
491+
{2048, 2048}, {16, 16}, 0);
486492
valid &= run_test<2, sycl::half, 4, sycl::image_channel_type::fp16,
487493
sycl::image_channel_order::rgba, class fp16_2d_c4>(
488494
{2048, 2048}, {16, 16}, 0);

sycl/test-e2e/bindless_images/vulkan_interop/unsampled_images.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -612,6 +612,17 @@ bool run_all() {
612612
valid &= run_test<2, uint8_t, 4, sycl::image_channel_type::unorm_int8,
613613
sycl::image_channel_order::rgba, class unorm_int8_2d_c4>(
614614
{2048, 2048}, {2, 2}, seed);
615+
616+
// 3-channels
617+
printString("Running 2D unorm_int8_c3\n");
618+
valid &= run_test<2, uint8_t, 3, sycl::image_channel_type::unorm_int8,
619+
sycl::image_channel_order::rgb, class unorm_int8_2d_c3>(
620+
{2048, 2048}, {2, 2}, seed);
621+
printString("Running 2D half3\n");
622+
valid &= run_test<2, sycl::half, 3, sycl::image_channel_type::fp16,
623+
sycl::image_channel_order::rgb, class fp16_2d_c3>(
624+
{2048, 2048}, {2, 2}, seed);
625+
615626
#else
616627
printString("Running 3D uint4\n");
617628
valid &= run_test<3, uint32_t, 4, sycl::image_channel_type::signed_int32,

sycl/test-e2e/bindless_images/vulkan_interop/vulkan_common.hpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -827,6 +827,8 @@ VkFormat to_vulkan_format(sycl::image_channel_order order,
827827
return VK_FORMAT_R8_UNORM;
828828
case sycl::image_channel_order::rg:
829829
return VK_FORMAT_R8G8_UNORM;
830+
case sycl::image_channel_order::rgb:
831+
return VK_FORMAT_R8G8B8_UNORM;
830832
case sycl::image_channel_order::rgba:
831833
return VK_FORMAT_R8G8B8A8_UNORM;
832834
default: {
@@ -894,6 +896,8 @@ VkFormat to_vulkan_format(sycl::image_channel_order order,
894896
return VK_FORMAT_R16_SFLOAT;
895897
case sycl::image_channel_order::rg:
896898
return VK_FORMAT_R16G16_SFLOAT;
899+
case sycl::image_channel_order::rgb:
900+
return VK_FORMAT_R16G16B16_SFLOAT;
897901
case sycl::image_channel_order::rgba:
898902
return VK_FORMAT_R16G16B16A16_SFLOAT;
899903
default: {

0 commit comments

Comments
 (0)