From 049d77e1e355ecca3547644dad3f591a9e10cb69 Mon Sep 17 00:00:00 2001 From: Andrea Bocci Date: Thu, 30 Jan 2025 21:38:56 +0100 Subject: [PATCH] Disable warp test not supported by SYCL (#2469) --- test/unit/warp/src/Activemask.cpp | 9 ++-- test/unit/warp/src/All.cpp | 83 ++++++++++++++++++------------- 2 files changed, 52 insertions(+), 40 deletions(-) diff --git a/test/unit/warp/src/Activemask.cpp b/test/unit/warp/src/Activemask.cpp index 223f3535f670..1a2ab109d75d 100644 --- a/test/unit/warp/src/Activemask.cpp +++ b/test/unit/warp/src/Activemask.cpp @@ -65,6 +65,9 @@ struct alpaka::trait::WarpSize TEMPLATE_LIST_TEST_CASE("activemask", "[warp]", alpaka::test::TestAccs) { using Acc = TestType; + using Dim = alpaka::Dim; + using Idx = alpaka::Idx; + if constexpr(alpaka::accMatchesTags< Acc, alpaka::TagCpuSycl, @@ -72,14 +75,10 @@ TEMPLATE_LIST_TEST_CASE("activemask", "[warp]", alpaka::test::TestAccs) alpaka::TagFpgaSyclIntel, alpaka::TagGenericSycl>) { - std::cout << "Test disabled for SYCL\n"; - return; + WARN("Test disabled for SYCL"); } else { - using Dim = alpaka::Dim; - using Idx = alpaka::Idx; - auto const platform = alpaka::Platform{}; auto const dev = alpaka::getDevByIdx(platform, 0); auto const warpExtents = alpaka::getWarpSizes(dev); diff --git a/test/unit/warp/src/All.cpp b/test/unit/warp/src/All.cpp index 61625b960d51..192c1687f9e2 100644 --- a/test/unit/warp/src/All.cpp +++ b/test/unit/warp/src/All.cpp @@ -70,46 +70,59 @@ TEMPLATE_LIST_TEST_CASE("all", "[warp]", alpaka::test::TestAccs) using Dim = alpaka::Dim; using Idx = alpaka::Idx; - auto const platform = alpaka::Platform{}; - auto const dev = alpaka::getDevByIdx(platform, 0); - auto const warpExtents = alpaka::getWarpSizes(dev); - for(auto const warpExtent : warpExtents) + if constexpr(alpaka::accMatchesTags< + Acc, + alpaka::TagCpuSycl, + alpaka::TagGpuSyclIntel, + alpaka::TagFpgaSyclIntel, + alpaka::TagGenericSycl>) { - auto const scalar = Dim::value == 0 || warpExtent == 1; - if(scalar) - { - alpaka::test::KernelExecutionFixture fixture(alpaka::Vec::all(4)); - REQUIRE(fixture(AllSingleThreadWarpTestKernel{})); - } - else + WARN("Test disabled for SYCL"); + } + else + { + auto const platform = alpaka::Platform{}; + auto const dev = alpaka::getDevByIdx(platform, 0); + auto const warpExtents = alpaka::getWarpSizes(dev); + for(auto const warpExtent : warpExtents) { - using ExecutionFixture = alpaka::test::KernelExecutionFixture; - auto const gridBlockExtent = alpaka::Vec::all(2); - // Enforce one warp per thread block - auto blockThreadExtent = alpaka::Vec::ones(); - blockThreadExtent[0] = static_cast(warpExtent); - auto const threadElementExtent = alpaka::Vec::ones(); - auto workDiv = typename ExecutionFixture::WorkDiv{gridBlockExtent, blockThreadExtent, threadElementExtent}; - auto fixture = ExecutionFixture{workDiv}; - if(warpExtent == 4) - { - REQUIRE(fixture(AllMultipleThreadWarpTestKernel<4>{})); - } - else if(warpExtent == 8) - { - REQUIRE(fixture(AllMultipleThreadWarpTestKernel<8>{})); - } - else if(warpExtent == 16) - { - REQUIRE(fixture(AllMultipleThreadWarpTestKernel<16>{})); - } - else if(warpExtent == 32) + auto const scalar = Dim::value == 0 || warpExtent == 1; + if(scalar) { - REQUIRE(fixture(AllMultipleThreadWarpTestKernel<32>{})); + alpaka::test::KernelExecutionFixture fixture(alpaka::Vec::all(4)); + REQUIRE(fixture(AllSingleThreadWarpTestKernel{})); } - else if(warpExtent == 64) + else { - REQUIRE(fixture(AllMultipleThreadWarpTestKernel<64>{})); + using ExecutionFixture = alpaka::test::KernelExecutionFixture; + auto const gridBlockExtent = alpaka::Vec::all(2); + // Enforce one warp per thread block + auto blockThreadExtent = alpaka::Vec::ones(); + blockThreadExtent[0] = static_cast(warpExtent); + auto const threadElementExtent = alpaka::Vec::ones(); + auto workDiv = + typename ExecutionFixture::WorkDiv{gridBlockExtent, blockThreadExtent, threadElementExtent}; + auto fixture = ExecutionFixture{workDiv}; + if(warpExtent == 4) + { + REQUIRE(fixture(AllMultipleThreadWarpTestKernel<4>{})); + } + else if(warpExtent == 8) + { + REQUIRE(fixture(AllMultipleThreadWarpTestKernel<8>{})); + } + else if(warpExtent == 16) + { + REQUIRE(fixture(AllMultipleThreadWarpTestKernel<16>{})); + } + else if(warpExtent == 32) + { + REQUIRE(fixture(AllMultipleThreadWarpTestKernel<32>{})); + } + else if(warpExtent == 64) + { + REQUIRE(fixture(AllMultipleThreadWarpTestKernel<64>{})); + } } } }