Skip to content

Commit f2aa92c

Browse files
authored
[SYCL][E2E][Bindless] Add 3-channel unorm_int8 and half vulkan-interop subtests for L0 (#16374)
Also disable failing unsampled unorm tests on intel gpu.
1 parent ecaab93 commit f2aa92c

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

sycl/test-e2e/bindless_images/dx12_interop/read_write_unsampled.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
// REQUIRES: build-and-run-mode
44

55
// DEFINE: %{link-flags}=%if cl_options %{ /clang:-ld3d12 /clang:-ldxgi /clang:-ldxguid %} %else %{ -ld3d12 -ldxgi -ldxguid %}
6-
// RUN: %{build} %{link-flags} -o %t.out
6+
// RUN: %{build} %{link-flags} -o %t.out %if any-device-is-level_zero %{ -DDISABLE_UNORM_TESTS %}
77
// RUN: %{run-unfiltered-devices} env NEOReadDebugKeys=1 UseBindlessMode=1 UseExternalAllocatorForSshAndDsh=1 %t.out
88

99
#pragma clang diagnostic ignored "-Waddress-of-temporary"
@@ -733,8 +733,10 @@ int main() {
733733
validated &=
734734
runTest<1, uint32_t, 1>(device, sycl::image_channel_type::unsigned_int32,
735735
globalSize1, localSize1);
736+
#ifndef DISABLE_UNORM_TESTS
736737
validated &= runTest<1, uint8_t, 4>(
737738
device, sycl::image_channel_type::unorm_int8, globalSize1, localSize1);
739+
#endif
738740
validated &= runTest<1, float, 1>(device, sycl::image_channel_type::fp32,
739741
globalSize1, localSize1);
740742
validated &= runTest<1, sycl::half, 2>(device, sycl::image_channel_type::fp16,
@@ -752,8 +754,10 @@ int main() {
752754
validated &=
753755
runTest<2, uint32_t, 1>(device, sycl::image_channel_type::unsigned_int32,
754756
globalSize2[0], {16, 16});
757+
#ifndef DISABLE_UNORM_TESTS
755758
validated &= runTest<2, uint8_t, 4>(
756759
device, sycl::image_channel_type::unorm_int8, globalSize2[1], {16, 8});
760+
#endif
757761
validated &= runTest<2, float, 1>(device, sycl::image_channel_type::fp32,
758762
globalSize2[2], {16, 8});
759763
validated &= runTest<2, sycl::half, 2>(device, sycl::image_channel_type::fp16,
@@ -774,8 +778,10 @@ int main() {
774778
validated &=
775779
runTest<3, uint32_t, 1>(device, sycl::image_channel_type::unsigned_int32,
776780
globalSize3[0], {16, 16, 1});
781+
#ifndef DISABLE_UNORM_TESTS
777782
validated &= runTest<3, uint8_t, 4>(
778783
device, sycl::image_channel_type::unorm_int8, globalSize3[1], {16, 8, 2});
784+
#endif
779785
validated &= runTest<3, float, 1>(device, sycl::image_channel_type::fp32,
780786
globalSize3[2], {16, 8, 1});
781787
validated &= runTest<3, sycl::half, 2>(device, sycl::image_channel_type::fp16,

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: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -590,11 +590,6 @@ bool run_all() {
590590
sycl::image_channel_order::rgba, class fp16_3d_c4>(
591591
{2048, 2048, 4}, {16, 16, 1}, seed);
592592

593-
printString("Running 3D unorm_int8_c4\n");
594-
valid &= run_test<3, uint8_t, 4, sycl::image_channel_type::unorm_int8,
595-
sycl::image_channel_order::rgba, class unorm_int8_3d_c4>(
596-
{2048, 2048, 2}, {16, 16, 1}, seed);
597-
598593
printString("Running 2D float\n");
599594
valid &= run_test<2, float, 1, sycl::image_channel_type::fp32,
600595
sycl::image_channel_order::r, class fp32_2d_c1>(
@@ -608,10 +603,12 @@ bool run_all() {
608603
sycl::image_channel_order::rgba, class fp16_2d_c4>(
609604
{2048, 2048}, {16, 16}, seed);
610605

611-
printString("Running 2D unorm_int8_c4\n");
612-
valid &= run_test<2, uint8_t, 4, sycl::image_channel_type::unorm_int8,
613-
sycl::image_channel_order::rgba, class unorm_int8_2d_c4>(
606+
// 3-channels
607+
printString("Running 2D half3\n");
608+
valid &= run_test<2, sycl::half, 3, sycl::image_channel_type::fp16,
609+
sycl::image_channel_order::rgb, class fp16_2d_c3>(
614610
{2048, 2048}, {2, 2}, seed);
611+
615612
#else
616613
printString("Running 3D uint4\n");
617614
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)