@@ -93,7 +93,8 @@ struct test_one_policy
93
93
}
94
94
};
95
95
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>
97
98
void
98
99
test (Predicate pred, _IteratorAdapter adap = {})
99
100
{
@@ -104,10 +105,11 @@ test(Predicate pred, _IteratorAdapter adap = {})
104
105
105
106
Sequence<Out> out (n, [](size_t ) { return -1 ; });
106
107
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);
111
113
}
112
114
}
113
115
@@ -129,19 +131,19 @@ int
129
131
main ()
130
132
{
131
133
// 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 ));
134
136
// non-const operator()
135
137
#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 )));
138
140
#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); });
140
142
141
143
test_algo_basic_double<std::int16_t >(run_for_rnd_fw<test_non_const<std::int16_t >>());
142
144
143
145
// 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{});
145
147
146
148
return done ();
147
149
}
0 commit comments