Skip to content

Commit 456bbe5

Browse files
[tests] Fix test compile errors for C++20 (#1567)
1 parent 3d34efa commit 456bbe5

13 files changed

+39
-0
lines changed

test/xpu_api/utilities/function.objects/bitwise.operations/bit_and.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelBitAndTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelBitAndTest>([=]() {
3536
typedef dpl::bit_and<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<int, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (f(0xEA95, 0xEA95) == 0xEA95);
4144
ret_access[0] &= (f(0xEA95, 0x58D3) == 0x4891);
4245
ret_access[0] &= (f(0x58D3, 0xEA95) == 0x4891);

test/xpu_api/utilities/function.objects/bitwise.operations/bit_not.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelBitNotTest;
2425

@@ -34,8 +35,10 @@ kernel_test()
3435
cgh.single_task<class KernelBitNotTest>([=]() {
3536
typedef dpl::bit_not<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<F::argument_type, int>::value);
3840
static_assert(dpl::is_same<F::result_type, int>::value);
41+
#endif // TEST_STD_VER < 20
3942
ret_access[0] = ((f(0xEA95) & 0xFFFF) == 0x156A);
4043
ret_access[0] &= ((f(0x58D3) & 0xFFFF) == 0xA72C);
4144
ret_access[0] &= ((f(0) & 0xFFFF) == 0xFFFF);

test/xpu_api/utilities/function.objects/bitwise.operations/bit_or.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelBitOrTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelBitOrTest>([=]() {
3536
typedef dpl::bit_or<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<int, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (f(0xEA95, 0xEA95) == 0xEA95);
4144
ret_access[0] &= (f(0xEA95, 0x58D3) == 0xFAD7);
4245
ret_access[0] &= (f(0x58D3, 0xEA95) == 0xFAD7);

test/xpu_api/utilities/function.objects/bitwise.operations/bit_xor.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelBitXorTest;
2425

@@ -35,9 +36,11 @@ kernel_test()
3536
{
3637
typedef dpl::bit_xor<int> F;
3738
const F f = F();
39+
#if TEST_STD_VER < 20
3840
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3941
static_assert(dpl::is_same<int, F::second_argument_type>::value);
4042
static_assert(dpl::is_same<int, F::result_type>::value);
43+
#endif // TEST_STD_VER < 20
4144
ret_access[0] = (f(0xEA95, 0xEA95) == 0);
4245
ret_access[0] &= (f(0xEA95, 0x58D3) == 0xB246);
4346
ret_access[0] &= (f(0x58D3, 0xEA95) == 0xB246);

test/xpu_api/utilities/function.objects/comparisons/equal_to.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelEqualToTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelEqualToTest>([=]() {
3536
typedef dpl::equal_to<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (f(36, 36));
4144
ret_access[0] &= (!f(36, 6));
4245

test/xpu_api/utilities/function.objects/comparisons/greater.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelGreaterTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelGreaterTest>([=]() {
3536
typedef dpl::greater<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (!f(36, 36));
4144
ret_access[0] &= (f(36, 6));
4245
ret_access[0] &= (!f(6, 36));

test/xpu_api/utilities/function.objects/comparisons/greater_equal.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelGreaterEqualTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelGreaterEqualTest>([=]() {
3536
typedef dpl::greater_equal<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (f(36, 36));
4144
ret_access[0] &= (f(36, 6));
4245
ret_access[0] &= (!f(6, 36));

test/xpu_api/utilities/function.objects/comparisons/less.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelLessTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelLessTest>([=]() {
3536
typedef dpl::less<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (!f(36, 36));
4144
ret_access[0] &= (!f(36, 6));
4245
ret_access[0] &= (f(6, 36));

test/xpu_api/utilities/function.objects/comparisons/less_equal.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelLessEqualTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelLessEqualTest>([=]() {
3536
typedef dpl::less_equal<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (f(36, 36));
4144
ret_access[0] &= (!f(36, 6));
4245
ret_access[0] &= (f(6, 36));

test/xpu_api/utilities/function.objects/comparisons/not_equal_to.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelNotEqualToTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelNotEqualToTest>([=]() {
3536
typedef dpl::not_equal_to<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (!f(36, 36));
4144
ret_access[0] &= (f(36, 6));
4245

test/xpu_api/utilities/function.objects/logical.operations/logical_and.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelLogicalAndTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelLogicalAndTest>([=]() {
3536
typedef dpl::logical_and<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (f(36, 36));
4144
ret_access[0] &= (!f(36, 0));
4245
ret_access[0] &= (!f(0, 36));

test/xpu_api/utilities/function.objects/logical.operations/logical_not.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelLogicalNotTest;
2425

@@ -34,8 +35,10 @@ kernel_test()
3435
cgh.single_task<class KernelLogicalNotTest>([=]() {
3536
typedef dpl::logical_not<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<F::argument_type, int>::value);
3840
static_assert(dpl::is_same<F::result_type, bool>::value);
41+
#endif // TEST_STD_VER < 20
3942
ret_access[0] = (!f(36));
4043
ret_access[0] &= (f(0));
4144

test/xpu_api/utilities/function.objects/logical.operations/logical_or.pass.cpp

+3
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
#include <oneapi/dpl/type_traits>
2020

2121
#include "support/utils.h"
22+
#include "support/test_macros.h"
2223

2324
class KernelLogicalOrTest;
2425

@@ -34,9 +35,11 @@ kernel_test()
3435
cgh.single_task<class KernelLogicalOrTest>([=]() {
3536
typedef dpl::logical_or<int> F;
3637
const F f = F();
38+
#if TEST_STD_VER < 20
3739
static_assert(dpl::is_same<int, F::first_argument_type>::value);
3840
static_assert(dpl::is_same<int, F::second_argument_type>::value);
3941
static_assert(dpl::is_same<bool, F::result_type>::value);
42+
#endif // TEST_STD_VER < 20
4043
ret_access[0] = (f(36, 36));
4144
ret_access[0] &= (f(36, 0));
4245
ret_access[0] &= (f(0, 36));

0 commit comments

Comments
 (0)