Skip to content

Commit

Permalink
Disable warp test not supported by SYCL (#2469)
Browse files Browse the repository at this point in the history
  • Loading branch information
fwyzard authored Jan 30, 2025
1 parent c2e81c3 commit 049d77e
Show file tree
Hide file tree
Showing 2 changed files with 52 additions and 40 deletions.
9 changes: 4 additions & 5 deletions test/unit/warp/src/Activemask.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -65,21 +65,20 @@ struct alpaka::trait::WarpSize<ActivemaskMultipleThreadWarpTestKernel<TWarpSize>
TEMPLATE_LIST_TEST_CASE("activemask", "[warp]", alpaka::test::TestAccs)
{
using Acc = TestType;
using Dim = alpaka::Dim<Acc>;
using Idx = alpaka::Idx<Acc>;

if constexpr(alpaka::accMatchesTags<
Acc,
alpaka::TagCpuSycl,
alpaka::TagGpuSyclIntel,
alpaka::TagFpgaSyclIntel,
alpaka::TagGenericSycl>)
{
std::cout << "Test disabled for SYCL\n";
return;
WARN("Test disabled for SYCL");
}
else
{
using Dim = alpaka::Dim<Acc>;
using Idx = alpaka::Idx<Acc>;

auto const platform = alpaka::Platform<Acc>{};
auto const dev = alpaka::getDevByIdx(platform, 0);
auto const warpExtents = alpaka::getWarpSizes(dev);
Expand Down
83 changes: 48 additions & 35 deletions test/unit/warp/src/All.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -70,46 +70,59 @@ TEMPLATE_LIST_TEST_CASE("all", "[warp]", alpaka::test::TestAccs)
using Dim = alpaka::Dim<Acc>;
using Idx = alpaka::Idx<Acc>;

auto const platform = alpaka::Platform<Acc>{};
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<Acc> fixture(alpaka::Vec<Dim, Idx>::all(4));
REQUIRE(fixture(AllSingleThreadWarpTestKernel{}));
}
else
WARN("Test disabled for SYCL");
}
else
{
auto const platform = alpaka::Platform<Acc>{};
auto const dev = alpaka::getDevByIdx(platform, 0);
auto const warpExtents = alpaka::getWarpSizes(dev);
for(auto const warpExtent : warpExtents)
{
using ExecutionFixture = alpaka::test::KernelExecutionFixture<Acc>;
auto const gridBlockExtent = alpaka::Vec<Dim, Idx>::all(2);
// Enforce one warp per thread block
auto blockThreadExtent = alpaka::Vec<Dim, Idx>::ones();
blockThreadExtent[0] = static_cast<Idx>(warpExtent);
auto const threadElementExtent = alpaka::Vec<Dim, Idx>::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<Acc> fixture(alpaka::Vec<Dim, Idx>::all(4));
REQUIRE(fixture(AllSingleThreadWarpTestKernel{}));
}
else if(warpExtent == 64)
else
{
REQUIRE(fixture(AllMultipleThreadWarpTestKernel<64>{}));
using ExecutionFixture = alpaka::test::KernelExecutionFixture<Acc>;
auto const gridBlockExtent = alpaka::Vec<Dim, Idx>::all(2);
// Enforce one warp per thread block
auto blockThreadExtent = alpaka::Vec<Dim, Idx>::ones();
blockThreadExtent[0] = static_cast<Idx>(warpExtent);
auto const threadElementExtent = alpaka::Vec<Dim, Idx>::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>{}));
}
}
}
}
Expand Down

0 comments on commit 049d77e

Please sign in to comment.