Skip to content

Commit

Permalink
[Tests] Skipping c++20 MSVC group comparison checks in kernel (uxlfou…
Browse files Browse the repository at this point in the history
…ndation#1568)


---------

Signed-off-by: Dan Hoeflinger <[email protected]>
  • Loading branch information
danhoeflinger authored May 16, 2024
1 parent 26a8d1e commit a006f9e
Show file tree
Hide file tree
Showing 12 changed files with 95 additions and 11 deletions.
6 changes: 6 additions & 0 deletions test/support/test_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,12 @@
#define _PSTL_TEST_COMPLEX_SINH_BROKEN _PSTL_TEST_COMPLEX_OP_BROKEN
#define _PSTL_TEST_COMPLEX_TANH_BROKEN _PSTL_TEST_COMPLEX_OP_BROKEN

// oneAPI DPC++ compiler 2024.2.0 and earlier is unable to eliminate a "dead" function call to an undefined function
// within a sycl kernel which MSVC uses to allow comparisons with literal zero without warning
#define _PSTL_TEST_COMPARISON_BROKEN \
((__cplusplus >= 202002L || _MSVC_LANG >= 202002L) && _MSVC_STL_VERSION >= 143 && _MSVC_STL_UPDATE >= 202303L && \
__INTEL_LLVM_COMPILER > 0 && __INTEL_LLVM_COMPILER <= 20240200)

#define _PSTL_TEST_COMPLEX_TIMES_COMPLEX_BROKEN _PSTL_TEST_COMPLEX_OP_BROKEN
#define _PSTL_TEST_COMPLEX_TIMES_COMPLEX_BROKEN_GLIBCXX (__GLIBCXX__ > 0 && __GLIBCXX__ <= 20210601)
#define _PSTL_TEST_COMPLEX_DIV_COMPLEX_BROKEN _PSTL_TEST_COMPLEX_OP_BROKEN
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand All @@ -42,12 +43,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of work with dpl::array and '>' in kernel_test");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand All @@ -42,12 +43,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of work with dpl::array and '>=' in kernel_test");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand All @@ -42,12 +43,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of work with dpl::array and '<' in kernel_test");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@

#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand All @@ -42,12 +43,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of work with dpl::array and '<=' in kernel_test");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
#include "support/test_macros.h"
#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
template <typename X>
bool
test(const X& x)
Expand Down Expand Up @@ -60,12 +61,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of dpl::tuple comparison check");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
9 changes: 8 additions & 1 deletion test/xpu_api/tuple/tuple.tuple/tuple.rel/lt.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "support/test_macros.h"
#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
class KernelTupleLTTest1;
class KernelTupleLTTest2;

Expand Down Expand Up @@ -304,16 +305,22 @@ kernel_test2(sycl::queue& deviceQueue)
auto ret_access_host = buffer1.get_host_access(sycl::read_only);
EXPECT_TRUE(ret_access_host[0], "Wrong result of dpl::tuple comparison check");
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
sycl::queue deviceQueue = TestUtils::get_test_queue();
kernel_test1(deviceQueue);
if (TestUtils::has_type_support<double>(deviceQueue.get_device()))
{
kernel_test2(deviceQueue);
}
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "support/test_macros.h"
#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand Down Expand Up @@ -48,12 +49,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of greater or equal value check");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "support/test_macros.h"
#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand Down Expand Up @@ -47,12 +48,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of greater value check");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "support/test_macros.h"
#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand Down Expand Up @@ -48,12 +49,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of less or equal check");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "support/test_macros.h"
#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
bool
kernel_test()
{
Expand Down Expand Up @@ -48,12 +49,18 @@ kernel_test()
}
return ret;
}
#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
auto ret = kernel_test();
EXPECT_TRUE(ret, "Wrong result of '...'less then' value check");
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}
10 changes: 9 additions & 1 deletion test/xpu_api/utilities/pairs/pairs.spec/comparison.pass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "support/test_macros.h"
#include "support/utils.h"

#if !_PSTL_TEST_COMPARISON_BROKEN
class KernelPairTest;
void
kernel_test()
Expand Down Expand Up @@ -97,10 +98,17 @@ kernel_test()
EXPECT_TRUE(ret_access_host[0], "Wrong result of dpl::pair comparison check");
}

#endif // !_PSTL_TEST_COMPARISON_BROKEN

int
main()
{
bool bProcessed = false;

#if !_PSTL_TEST_COMPARISON_BROKEN
kernel_test();
bProcessed = true;
#endif // !_PSTL_TEST_COMPARISON_BROKEN

return TestUtils::done();
return TestUtils::done(bProcessed);
}

0 comments on commit a006f9e

Please sign in to comment.