From f732ef3c7238f5073b43e2850fc1b4ca2a2b92ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Peter=20=C5=BDu=C5=BEek?= Date: Fri, 7 Jun 2024 12:09:39 +0200 Subject: [PATCH] [SYCL][Bindless] Enable non-Vulkan tests on Windows (#14045) Bindless Images should now properly work on Windows, with the exception of Vulkan interop, which requires extra work. Required a few fixes to non-conformant C++ code. --- sycl/test-e2e/bindless_images/bindless_helpers.hpp | 4 +++- sycl/test-e2e/bindless_images/cubemap/cubemap_sampled.cpp | 2 +- sycl/test-e2e/bindless_images/cubemap/cubemap_unsampled.cpp | 2 +- sycl/test-e2e/bindless_images/device_to_device_copy.cpp | 1 - sycl/test-e2e/bindless_images/image_get_info.cpp | 1 - sycl/test-e2e/bindless_images/mipmap/mipmap_read_1D.cpp | 5 ++--- sycl/test-e2e/bindless_images/mipmap/mipmap_read_2D.cpp | 5 ++--- sycl/test-e2e/bindless_images/mipmap/mipmap_read_3D.cpp | 5 ++--- sycl/test-e2e/bindless_images/read_1D.cpp | 1 - sycl/test-e2e/bindless_images/read_2D.cpp | 1 - sycl/test-e2e/bindless_images/read_2D_dynamic.cpp | 1 - sycl/test-e2e/bindless_images/read_3D.cpp | 1 - sycl/test-e2e/bindless_images/read_norm_types.cpp | 1 - sycl/test-e2e/bindless_images/read_sampled.cpp | 1 - sycl/test-e2e/bindless_images/read_write_1D.cpp | 1 - sycl/test-e2e/bindless_images/read_write_1D_subregion.cpp | 1 - sycl/test-e2e/bindless_images/read_write_2D.cpp | 1 - sycl/test-e2e/bindless_images/read_write_2D_subregion.cpp | 1 - sycl/test-e2e/bindless_images/read_write_3D.cpp | 1 - sycl/test-e2e/bindless_images/read_write_3D_subregion.cpp | 1 - sycl/test-e2e/bindless_images/read_write_unsampled.cpp | 1 - sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM.cpp | 1 - sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D.cpp | 1 - sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM.cpp | 1 - sycl/test-e2e/bindless_images/sampled_fetch/fetch_3D.cpp | 1 - sycl/test-e2e/bindless_images/sampling_1D.cpp | 1 - sycl/test-e2e/bindless_images/sampling_2D.cpp | 1 - sycl/test-e2e/bindless_images/sampling_2D_USM_shared.cpp | 1 - sycl/test-e2e/bindless_images/sampling_2D_half.cpp | 1 - sycl/test-e2e/bindless_images/sampling_3D.cpp | 1 - sycl/test-e2e/bindless_images/sampling_unique_addr_modes.cpp | 1 - .../bindless_images/user_types/mipmap_read_user_type_2D.cpp | 1 - .../bindless_images/user_types/read_write_user_type.cpp | 1 - 33 files changed, 11 insertions(+), 39 deletions(-) diff --git a/sycl/test-e2e/bindless_images/bindless_helpers.hpp b/sycl/test-e2e/bindless_images/bindless_helpers.hpp index f8668d054e0ae..618c29fb06745 100644 --- a/sycl/test-e2e/bindless_images/bindless_helpers.hpp +++ b/sycl/test-e2e/bindless_images/bindless_helpers.hpp @@ -53,6 +53,8 @@ static void fill_rand(std::vector> &v, return std::uniform_real_distribution(0.0, 100.0); } else if constexpr (std::is_floating_point_v) { return std::uniform_real_distribution(0.0, 100.0); + } else if constexpr (sizeof(DType) == 1) { + return std::uniform_int_distribution(0, 100); } else { return std::uniform_int_distribution(0, 100); } @@ -61,7 +63,7 @@ static void fill_rand(std::vector> &v, sycl::vec temp; for (int j = 0; j < NChannels; j++) { - temp[j] = distribution(generator); + temp[j] = static_cast(distribution(generator)); } v[i] = temp; diff --git a/sycl/test-e2e/bindless_images/cubemap/cubemap_sampled.cpp b/sycl/test-e2e/bindless_images/cubemap/cubemap_sampled.cpp index 63d213586e4f5..71f9253b239a2 100644 --- a/sycl/test-e2e/bindless_images/cubemap/cubemap_sampled.cpp +++ b/sycl/test-e2e/bindless_images/cubemap/cubemap_sampled.cpp @@ -1,4 +1,4 @@ -// REQUIRES: linux,cuda,aspect-ext_oneapi_cubemap +// REQUIRES: cuda,aspect-ext_oneapi_cubemap // REQUIRES: aspect-ext_oneapi_cubemap_seamless_filtering // RUN: %{build} -o %t.out diff --git a/sycl/test-e2e/bindless_images/cubemap/cubemap_unsampled.cpp b/sycl/test-e2e/bindless_images/cubemap/cubemap_unsampled.cpp index 383440d7835a2..413045190e54c 100644 --- a/sycl/test-e2e/bindless_images/cubemap/cubemap_unsampled.cpp +++ b/sycl/test-e2e/bindless_images/cubemap/cubemap_unsampled.cpp @@ -1,4 +1,4 @@ -// REQUIRES: linux,cuda,aspect-ext_oneapi_cubemap +// REQUIRES: cuda,aspect-ext_oneapi_cubemap // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out // RUN: %t.out diff --git a/sycl/test-e2e/bindless_images/device_to_device_copy.cpp b/sycl/test-e2e/bindless_images/device_to_device_copy.cpp index 3ca37772e4f5e..4a9263e44a13e 100644 --- a/sycl/test-e2e/bindless_images/device_to_device_copy.cpp +++ b/sycl/test-e2e/bindless_images/device_to_device_copy.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %{build} -o %t.out diff --git a/sycl/test-e2e/bindless_images/image_get_info.cpp b/sycl/test-e2e/bindless_images/image_get_info.cpp index b9dc8d19fc1c9..e30eded427da1 100644 --- a/sycl/test-e2e/bindless_images/image_get_info.cpp +++ b/sycl/test-e2e/bindless_images/image_get_info.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/mipmap/mipmap_read_1D.cpp b/sycl/test-e2e/bindless_images/mipmap/mipmap_read_1D.cpp index 003c48a7aac07..91f725dad01e3 100644 --- a/sycl/test-e2e/bindless_images/mipmap/mipmap_read_1D.cpp +++ b/sycl/test-e2e/bindless_images/mipmap/mipmap_read_1D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out @@ -160,13 +159,13 @@ int main() { failed += runTest(); - failed += runTest(); + failed += runTest(); failed += runTest(); failed += runTest(); - failed += runTest(); + failed += runTest(); failed += runTest(); diff --git a/sycl/test-e2e/bindless_images/mipmap/mipmap_read_2D.cpp b/sycl/test-e2e/bindless_images/mipmap/mipmap_read_2D.cpp index 472f31487eded..afedf976077cf 100644 --- a/sycl/test-e2e/bindless_images/mipmap/mipmap_read_2D.cpp +++ b/sycl/test-e2e/bindless_images/mipmap/mipmap_read_2D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out @@ -167,13 +166,13 @@ int main() { failed += runTest(); - failed += runTest(); + failed += runTest(); failed += runTest(); failed += runTest(); - failed += runTest(); + failed += runTest(); failed += runTest(); diff --git a/sycl/test-e2e/bindless_images/mipmap/mipmap_read_3D.cpp b/sycl/test-e2e/bindless_images/mipmap/mipmap_read_3D.cpp index e3d11bcb7c567..b2c5f7ae42b71 100644 --- a/sycl/test-e2e/bindless_images/mipmap/mipmap_read_3D.cpp +++ b/sycl/test-e2e/bindless_images/mipmap/mipmap_read_3D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out @@ -159,13 +158,13 @@ int main() { failed += runTest(); - failed += runTest(); + failed += runTest(); failed += runTest(); failed += runTest(); - failed += runTest(); + failed += runTest(); failed += runTest(); diff --git a/sycl/test-e2e/bindless_images/read_1D.cpp b/sycl/test-e2e/bindless_images/read_1D.cpp index 624e3d69aa8a0..c85157cf7f8b2 100644 --- a/sycl/test-e2e/bindless_images/read_1D.cpp +++ b/sycl/test-e2e/bindless_images/read_1D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_2D.cpp b/sycl/test-e2e/bindless_images/read_2D.cpp index 3b3ff18f8421d..5c5dbb5fc59f9 100644 --- a/sycl/test-e2e/bindless_images/read_2D.cpp +++ b/sycl/test-e2e/bindless_images/read_2D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_2D_dynamic.cpp b/sycl/test-e2e/bindless_images/read_2D_dynamic.cpp index e5de53c8c5fa3..377e0103b56c9 100644 --- a/sycl/test-e2e/bindless_images/read_2D_dynamic.cpp +++ b/sycl/test-e2e/bindless_images/read_2D_dynamic.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_3D.cpp b/sycl/test-e2e/bindless_images/read_3D.cpp index 556a37e555e7d..b77bfaa298752 100644 --- a/sycl/test-e2e/bindless_images/read_3D.cpp +++ b/sycl/test-e2e/bindless_images/read_3D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_norm_types.cpp b/sycl/test-e2e/bindless_images/read_norm_types.cpp index 8cb3b2117c175..aa2daa29b1bad 100644 --- a/sycl/test-e2e/bindless_images/read_norm_types.cpp +++ b/sycl/test-e2e/bindless_images/read_norm_types.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %{build} -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_sampled.cpp b/sycl/test-e2e/bindless_images/read_sampled.cpp index 7fe41261f2f5d..0972c3401b7b9 100644 --- a/sycl/test-e2e/bindless_images/read_sampled.cpp +++ b/sycl/test-e2e/bindless_images/read_sampled.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_write_1D.cpp b/sycl/test-e2e/bindless_images/read_write_1D.cpp index d6b985b203dd9..7f366ae682039 100644 --- a/sycl/test-e2e/bindless_images/read_write_1D.cpp +++ b/sycl/test-e2e/bindless_images/read_write_1D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_write_1D_subregion.cpp b/sycl/test-e2e/bindless_images/read_write_1D_subregion.cpp index f866af948a52c..3572150cbd12f 100644 --- a/sycl/test-e2e/bindless_images/read_write_1D_subregion.cpp +++ b/sycl/test-e2e/bindless_images/read_write_1D_subregion.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_write_2D.cpp b/sycl/test-e2e/bindless_images/read_write_2D.cpp index 28246fb6211a7..6fa09ea4a1eea 100644 --- a/sycl/test-e2e/bindless_images/read_write_2D.cpp +++ b/sycl/test-e2e/bindless_images/read_write_2D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_write_2D_subregion.cpp b/sycl/test-e2e/bindless_images/read_write_2D_subregion.cpp index dddb9100ab85a..c227734d3a00a 100644 --- a/sycl/test-e2e/bindless_images/read_write_2D_subregion.cpp +++ b/sycl/test-e2e/bindless_images/read_write_2D_subregion.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_write_3D.cpp b/sycl/test-e2e/bindless_images/read_write_3D.cpp index 1bcbed6a9fe4d..efb87a8ff9f4a 100644 --- a/sycl/test-e2e/bindless_images/read_write_3D.cpp +++ b/sycl/test-e2e/bindless_images/read_write_3D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_write_3D_subregion.cpp b/sycl/test-e2e/bindless_images/read_write_3D_subregion.cpp index adbee77c2873f..6631260dc15f1 100644 --- a/sycl/test-e2e/bindless_images/read_write_3D_subregion.cpp +++ b/sycl/test-e2e/bindless_images/read_write_3D_subregion.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/read_write_unsampled.cpp b/sycl/test-e2e/bindless_images/read_write_unsampled.cpp index 1ac11302224d2..cae8cbc32b3d2 100644 --- a/sycl/test-e2e/bindless_images/read_write_unsampled.cpp +++ b/sycl/test-e2e/bindless_images/read_write_unsampled.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM.cpp b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM.cpp index d8d7e6e50fb30..965dc9f00c1c4 100644 --- a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM.cpp +++ b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_1D_USM.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // REQUIRES: aspect-ext_oneapi_bindless_sampled_image_fetch_1d_usm diff --git a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D.cpp b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D.cpp index c85852dba64fd..0a6da2d97f136 100644 --- a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D.cpp +++ b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // REQUIRES: aspect-ext_oneapi_bindless_sampled_image_fetch_2d diff --git a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM.cpp b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM.cpp index 2258e4f098494..834ec5b6e8c79 100644 --- a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM.cpp +++ b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_2D_USM.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // REQUIRES: aspect-ext_oneapi_bindless_sampled_image_fetch_2d_usm diff --git a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_3D.cpp b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_3D.cpp index 3c534e7329f96..ccb096dbfbdc5 100644 --- a/sycl/test-e2e/bindless_images/sampled_fetch/fetch_3D.cpp +++ b/sycl/test-e2e/bindless_images/sampled_fetch/fetch_3D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // REQUIRES: aspect-ext_oneapi_bindless_sampled_image_fetch_3d diff --git a/sycl/test-e2e/bindless_images/sampling_1D.cpp b/sycl/test-e2e/bindless_images/sampling_1D.cpp index b80a640aa370b..ef184c112568c 100644 --- a/sycl/test-e2e/bindless_images/sampling_1D.cpp +++ b/sycl/test-e2e/bindless_images/sampling_1D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/sampling_2D.cpp b/sycl/test-e2e/bindless_images/sampling_2D.cpp index 33dac190a4b68..92a26df5afc38 100644 --- a/sycl/test-e2e/bindless_images/sampling_2D.cpp +++ b/sycl/test-e2e/bindless_images/sampling_2D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/sampling_2D_USM_shared.cpp b/sycl/test-e2e/bindless_images/sampling_2D_USM_shared.cpp index aefd953b6f46d..52775a8b0806c 100644 --- a/sycl/test-e2e/bindless_images/sampling_2D_USM_shared.cpp +++ b/sycl/test-e2e/bindless_images/sampling_2D_USM_shared.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // REQUIRES: aspect-ext_oneapi_bindless_images_shared_usm diff --git a/sycl/test-e2e/bindless_images/sampling_2D_half.cpp b/sycl/test-e2e/bindless_images/sampling_2D_half.cpp index fc34dfcb13c50..aeb57976df5aa 100644 --- a/sycl/test-e2e/bindless_images/sampling_2D_half.cpp +++ b/sycl/test-e2e/bindless_images/sampling_2D_half.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // REQUIRES: aspect-fp16 diff --git a/sycl/test-e2e/bindless_images/sampling_3D.cpp b/sycl/test-e2e/bindless_images/sampling_3D.cpp index 518b0e873d583..47d98aaf0be97 100644 --- a/sycl/test-e2e/bindless_images/sampling_3D.cpp +++ b/sycl/test-e2e/bindless_images/sampling_3D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %clangxx -fsycl -fsycl-targets=%{sycl_triple} %s -o %t.out diff --git a/sycl/test-e2e/bindless_images/sampling_unique_addr_modes.cpp b/sycl/test-e2e/bindless_images/sampling_unique_addr_modes.cpp index eea7f53c5c0e3..895f7082adce6 100644 --- a/sycl/test-e2e/bindless_images/sampling_unique_addr_modes.cpp +++ b/sycl/test-e2e/bindless_images/sampling_unique_addr_modes.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %{build} -o %t.out diff --git a/sycl/test-e2e/bindless_images/user_types/mipmap_read_user_type_2D.cpp b/sycl/test-e2e/bindless_images/user_types/mipmap_read_user_type_2D.cpp index 1e55ac489c2a3..77913a2836565 100644 --- a/sycl/test-e2e/bindless_images/user_types/mipmap_read_user_type_2D.cpp +++ b/sycl/test-e2e/bindless_images/user_types/mipmap_read_user_type_2D.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %{build} -o %t.out diff --git a/sycl/test-e2e/bindless_images/user_types/read_write_user_type.cpp b/sycl/test-e2e/bindless_images/user_types/read_write_user_type.cpp index 7a55e31e40fba..db9347f9895e6 100644 --- a/sycl/test-e2e/bindless_images/user_types/read_write_user_type.cpp +++ b/sycl/test-e2e/bindless_images/user_types/read_write_user_type.cpp @@ -1,4 +1,3 @@ -// REQUIRES: linux // REQUIRES: cuda // RUN: %{build} -o %t.out