Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Disable test not supported by SYCL #2468

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Disable test not supported by SYCL
  • Loading branch information
fwyzard committed Jan 30, 2025
commit b68618e369617ec4e3873d43d9064f9d45cc90e4
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
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note that most of these changes are simply due to a different indentation.

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