diff --git a/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp b/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp index 2a874b5d4de..d3777c536e5 100644 --- a/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp +++ b/test/parallel_api/algorithm/alg.modifying.operations/transform_binary.pass.cpp @@ -93,7 +93,8 @@ struct test_one_policy } }; -template +template <::std::size_t CallNumber, typename In1, typename In2, typename Out, typename Predicate, + typename _IteratorAdapter = _Identity> void test(Predicate pred, _IteratorAdapter adap = {}) { @@ -104,10 +105,11 @@ test(Predicate pred, _IteratorAdapter adap = {}) Sequence out(n, [](size_t) { return -1; }); - invoke_on_all_policies<0>()(test_one_policy(), adap(in1.begin()), adap(in1.end()), adap(in2.begin()), - adap(in2.end()), adap(out.begin()), adap(out.end()), pred); - invoke_on_all_policies<1>()(test_one_policy(), adap(in1.cbegin()), adap(in1.cend()), adap(in2.cbegin()), - adap(in2.cend()), adap(out.begin()), adap(out.end()), pred); + invoke_on_all_policies()(test_one_policy(), adap(in1.begin()), adap(in1.end()), adap(in2.begin()), + adap(in2.end()), adap(out.begin()), adap(out.end()), pred); + invoke_on_all_policies()(test_one_policy(), adap(in1.cbegin()), adap(in1.cend()), + adap(in2.cbegin()), adap(in2.cend()), adap(out.begin()), + adap(out.end()), pred); } } @@ -129,19 +131,19 @@ int main() { //const operator() - test(TheOperation(1)); - test(TheOperation(1.5)); + test<0, std::int32_t, std::int32_t, std::int32_t>(TheOperation(1)); + test<10, float32_t, float32_t, float32_t>(TheOperation(1.5)); //non-const operator() #if !TEST_DPCPP_BACKEND_PRESENT - test(non_const(TheOperation(1.5))); - test(non_const(TheOperation(1.5))); + test<20, std::int32_t, float32_t, float32_t>(non_const(TheOperation(1.5))); + test<30, std::int64_t, float64_t, float32_t>(non_const(TheOperation(1.5))); #endif - test([](const std::int32_t& x, const float64_t& y) { return std::int32_t(std::int32_t(1.5) + x - y); }); + 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); }); test_algo_basic_double(run_for_rnd_fw>()); //test case for zip iterator - test(TheOperationZip(1), _ZipIteratorAdapter{}); + test<50, std::int32_t, std::int32_t, std::int32_t>(TheOperationZip(1), _ZipIteratorAdapter{}); return done(); } diff --git a/test/parallel_api/algorithm/alg.modifying.operations/transform_unary.pass.cpp b/test/parallel_api/algorithm/alg.modifying.operations/transform_unary.pass.cpp index 49d1a3924f8..20c1403f6b9 100644 --- a/test/parallel_api/algorithm/alg.modifying.operations/transform_unary.pass.cpp +++ b/test/parallel_api/algorithm/alg.modifying.operations/transform_unary.pass.cpp @@ -79,7 +79,8 @@ struct test_one_policy } }; -template , typename _IteratorAdapter = _Identity> +template <::std::size_t CallNumber, typename Tin, typename Tout, typename _Op = Complement, + typename _IteratorAdapter = _Identity> void test() { @@ -90,12 +91,12 @@ test() Sequence out(n); _IteratorAdapter adap; - invoke_on_all_policies<0>()(test_one_policy(), adap(in.begin()), adap(in.end()), adap(out.begin()), - adap(out.end()), _Op{}); + invoke_on_all_policies()(test_one_policy(), adap(in.begin()), adap(in.end()), adap(out.begin()), + adap(out.end()), _Op{}); #if !ONEDPL_FPGA_DEVICE - invoke_on_all_policies<1>()(test_one_policy(), adap(in.cbegin()), adap(in.cend()), adap(out.begin()), - adap(out.end()), _Op{}); + invoke_on_all_policies()(test_one_policy(), adap(in.cbegin()), adap(in.cend()), + adap(out.begin()), adap(out.end()), _Op{}); #endif } } @@ -114,16 +115,16 @@ struct test_non_const int main() { - test(); - test(); - test(); - test(); + test<0, std::int32_t, std::int32_t>(); + test<10, std::int32_t, float32_t>(); + test<20, std::uint16_t, float32_t>(); + test<30, float64_t, float64_t>(); test_algo_basic_double(run_for_rnd_fw>()); test_algo_basic_double(run_for_rnd_fw>()); //test case for zip iterator - test(); + test<40, std::int32_t, std::int32_t, ComplementZip, _ZipIteratorAdapter>(); return done(); }