Skip to content

Commit 4cdc990

Browse files
[test] Fix Kernel names in tests (#1389)
1 parent bbda778 commit 4cdc990

File tree

2 files changed

+24
-21
lines changed

2 files changed

+24
-21
lines changed

test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp

+13-11
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,8 @@ struct test_one_policy
9393
}
9494
};
9595

96-
template <typename In1, typename In2, typename Out, typename Predicate, typename _IteratorAdapter = _Identity>
96+
template <::std::size_t CallNumber, typename In1, typename In2, typename Out, typename Predicate,
97+
typename _IteratorAdapter = _Identity>
9798
void
9899
test(Predicate pred, _IteratorAdapter adap = {})
99100
{
@@ -104,10 +105,11 @@ test(Predicate pred, _IteratorAdapter adap = {})
104105

105106
Sequence<Out> out(n, [](size_t) { return -1; });
106107

107-
invoke_on_all_policies<0>()(test_one_policy(), adap(in1.begin()), adap(in1.end()), adap(in2.begin()),
108-
adap(in2.end()), adap(out.begin()), adap(out.end()), pred);
109-
invoke_on_all_policies<1>()(test_one_policy(), adap(in1.cbegin()), adap(in1.cend()), adap(in2.cbegin()),
110-
adap(in2.cend()), adap(out.begin()), adap(out.end()), pred);
108+
invoke_on_all_policies<CallNumber>()(test_one_policy(), adap(in1.begin()), adap(in1.end()), adap(in2.begin()),
109+
adap(in2.end()), adap(out.begin()), adap(out.end()), pred);
110+
invoke_on_all_policies<CallNumber + 1>()(test_one_policy(), adap(in1.cbegin()), adap(in1.cend()),
111+
adap(in2.cbegin()), adap(in2.cend()), adap(out.begin()),
112+
adap(out.end()), pred);
111113
}
112114
}
113115

@@ -129,19 +131,19 @@ int
129131
main()
130132
{
131133
//const operator()
132-
test<std::int32_t, std::int32_t, std::int32_t>(TheOperation<std::int32_t, std::int32_t, std::int32_t>(1));
133-
test<float32_t, float32_t, float32_t>(TheOperation<float32_t, float32_t, float32_t>(1.5));
134+
test<0, std::int32_t, std::int32_t, std::int32_t>(TheOperation<std::int32_t, std::int32_t, std::int32_t>(1));
135+
test<10, float32_t, float32_t, float32_t>(TheOperation<float32_t, float32_t, float32_t>(1.5));
134136
//non-const operator()
135137
#if !TEST_DPCPP_BACKEND_PRESENT
136-
test<std::int32_t, float32_t, float32_t>(non_const(TheOperation<std::int32_t, float32_t, float32_t>(1.5)));
137-
test<std::int64_t, float64_t, float32_t>(non_const(TheOperation<std::int64_t, float64_t, float32_t>(1.5)));
138+
test<20, std::int32_t, float32_t, float32_t>(non_const(TheOperation<std::int32_t, float32_t, float32_t>(1.5)));
139+
test<30, std::int64_t, float64_t, float32_t>(non_const(TheOperation<std::int64_t, float64_t, float32_t>(1.5)));
138140
#endif
139-
test<std::int32_t, float64_t, std::int32_t>([](const std::int32_t& x, const float64_t& y) { return std::int32_t(std::int32_t(1.5) + x - y); });
141+
test<40, std::int32_t, float64_t, std::int32_t>([](const std::int32_t& x, const float64_t& y) { return std::int32_t(std::int32_t(1.5) + x - y); });
140142

141143
test_algo_basic_double<std::int16_t>(run_for_rnd_fw<test_non_const<std::int16_t>>());
142144

143145
//test case for zip iterator
144-
test<std::int32_t, std::int32_t, std::int32_t>(TheOperationZip<std::int32_t>(1), _ZipIteratorAdapter{});
146+
test<50, std::int32_t, std::int32_t, std::int32_t>(TheOperationZip<std::int32_t>(1), _ZipIteratorAdapter{});
145147

146148
return done();
147149
}

test/parallel_api/algorithm/alg.modifying.operations/transform_unary.pass.cpp

+11-10
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,8 @@ struct test_one_policy
7979
}
8080
};
8181

82-
template <typename Tin, typename Tout, typename _Op = Complement<Tin, Tout>, typename _IteratorAdapter = _Identity>
82+
template <::std::size_t CallNumber, typename Tin, typename Tout, typename _Op = Complement<Tin, Tout>,
83+
typename _IteratorAdapter = _Identity>
8384
void
8485
test()
8586
{
@@ -90,12 +91,12 @@ test()
9091
Sequence<Tout> out(n);
9192

9293
_IteratorAdapter adap;
93-
invoke_on_all_policies<0>()(test_one_policy(), adap(in.begin()), adap(in.end()), adap(out.begin()),
94-
adap(out.end()), _Op{});
94+
invoke_on_all_policies<CallNumber>()(test_one_policy(), adap(in.begin()), adap(in.end()), adap(out.begin()),
95+
adap(out.end()), _Op{});
9596

9697
#if !ONEDPL_FPGA_DEVICE
97-
invoke_on_all_policies<1>()(test_one_policy(), adap(in.cbegin()), adap(in.cend()), adap(out.begin()),
98-
adap(out.end()), _Op{});
98+
invoke_on_all_policies<CallNumber + 1>()(test_one_policy(), adap(in.cbegin()), adap(in.cend()),
99+
adap(out.begin()), adap(out.end()), _Op{});
99100
#endif
100101
}
101102
}
@@ -114,16 +115,16 @@ struct test_non_const
114115
int
115116
main()
116117
{
117-
test<std::int32_t, std::int32_t>();
118-
test<std::int32_t, float32_t>();
119-
test<std::uint16_t, float32_t>();
120-
test<float64_t, float64_t>();
118+
test<0, std::int32_t, std::int32_t>();
119+
test<10, std::int32_t, float32_t>();
120+
test<20, std::uint16_t, float32_t>();
121+
test<30, float64_t, float64_t>();
121122

122123
test_algo_basic_double<std::int32_t>(run_for_rnd_fw<test_non_const<std::int32_t>>());
123124
test_algo_basic_double<std::int64_t>(run_for_rnd_fw<test_non_const<std::int32_t>>());
124125

125126
//test case for zip iterator
126-
test<std::int32_t, std::int32_t, ComplementZip, _ZipIteratorAdapter>();
127+
test<40, std::int32_t, std::int32_t, ComplementZip, _ZipIteratorAdapter>();
127128

128129
return done();
129130
}

0 commit comments

Comments
 (0)