Skip to content

Commit

Permalink
Skip bessel function tests known to fail on Intel GPUs (kokkos#6434)
Browse files Browse the repository at this point in the history
* Skip bessel function tests known to fail on Intel GPUs

* Explain magic values for upper_limit
  • Loading branch information
masterleinad committed Sep 19, 2023
1 parent 3cd2813 commit 5ed274c
Showing 1 changed file with 34 additions and 7 deletions.
41 changes: 34 additions & 7 deletions core/unit_test/TestMathematicalSpecialFunctions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -1207,9 +1207,16 @@ struct TestComplexBesselI0K0Function {
}

EXPECT_EQ(h_ref_cbk0(0), h_cbk0(0));
for (int i = 1; i < N; i++) {
int upper_limit = N;
// FIXME_SYCL Failing for Intel GPUs, 19 is the first failing test case
#if defined(KOKKOS_ENABLE_SYCL) && defined(KOKKOS_ARCH_INTEL_GPU)
if (std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
upper_limit = 19;
#endif
for (int i = 1; i < upper_limit; i++) {
EXPECT_LE(Kokkos::abs(h_cbk0(i) - h_ref_cbk0(i)),
Kokkos::abs(h_ref_cbk0(i)) * 1e-13);
Kokkos::abs(h_ref_cbk0(i)) * 1e-13)
<< "at index " << i;
}
#endif

Expand Down Expand Up @@ -1449,9 +1456,16 @@ struct TestComplexBesselI1K1Function {
}

EXPECT_EQ(h_ref_cbk1(0), h_cbk1(0));
for (int i = 1; i < N; i++) {
int upper_limit = N;
// FIXME_SYCL Failing for Intel GPUs, 8 is the first failing test case
#if defined(KOKKOS_ENABLE_SYCL) && defined(KOKKOS_ARCH_INTEL_GPU)
if (std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
upper_limit = 8;
#endif
for (int i = 1; i < upper_limit; i++) {
EXPECT_LE(Kokkos::abs(h_cbk1(i) - h_ref_cbk1(i)),
Kokkos::abs(h_ref_cbk1(i)) * 1e-13);
Kokkos::abs(h_ref_cbk1(i)) * 1e-13)
<< "at index " << i;
}

////Test large arguments
Expand Down Expand Up @@ -1705,7 +1719,13 @@ struct TestComplexBesselH1Function {
}

EXPECT_EQ(h_ref_ch11(0), h_ch11(0));
for (int i = 1; i < N; i++) {
int upper_limit = N;
// FIXME_SYCL Failing for Intel GPUs, 16 is the first failing test case
#if defined(KOKKOS_ENABLE_SYCL) && defined(KOKKOS_ARCH_INTEL_GPU)
if (std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
upper_limit = 16;
#endif
for (int i = 1; i < upper_limit; i++) {
EXPECT_LE(Kokkos::abs(h_ch11(i) - h_ref_ch11(i)),
Kokkos::abs(h_ref_ch11(i)) * 1e-13)
<< "at index " << i;
Expand Down Expand Up @@ -1892,9 +1912,16 @@ struct TestComplexBesselH2Function {
}

EXPECT_EQ(h_ref_ch21(0), h_ch21(0));
for (int i = 1; i < N; i++) {
int upper_limit = N;
// FIXME_SYCL Failing for Intel GPUs, 17 is the first failing test case
#if defined(KOKKOS_ENABLE_SYCL) && defined(KOKKOS_ARCH_INTEL_GPU)
if (std::is_same_v<TEST_EXECSPACE, Kokkos::Experimental::SYCL>)
upper_limit = 17;
#endif
for (int i = 1; i < upper_limit; i++) {
EXPECT_LE(Kokkos::abs(h_ch21(i) - h_ref_ch21(i)),
Kokkos::abs(h_ref_ch21(i)) * 1e-13);
Kokkos::abs(h_ref_ch21(i)) * 1e-13)
<< "at index " << i;
}
#endif
}
Expand Down

0 comments on commit 5ed274c

Please sign in to comment.