mirror of
https://github.com/boostorg/compute.git
synced 2026-02-19 02:12:19 +00:00
Add for_each_n() algorithm
This commit is contained in:
@@ -14,6 +14,7 @@
|
||||
#include <boost/compute/function.hpp>
|
||||
#include <boost/compute/algorithm/iota.hpp>
|
||||
#include <boost/compute/algorithm/for_each.hpp>
|
||||
#include <boost/compute/algorithm/for_each_n.hpp>
|
||||
#include <boost/compute/container/vector.hpp>
|
||||
|
||||
#include "context_setup.hpp"
|
||||
@@ -30,4 +31,14 @@ BOOST_AUTO_TEST_CASE(for_each_nop)
|
||||
bc::for_each(vector.begin(), vector.end(), nop, queue);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(for_each_n_nop)
|
||||
{
|
||||
bc::vector<int> vector(4, context);
|
||||
bc::iota(vector.begin(), vector.end(), 0);
|
||||
|
||||
BOOST_COMPUTE_FUNCTION(void, nop, (int ignored), {});
|
||||
|
||||
bc::for_each_n(vector.begin(), vector.size(), nop, queue);
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_SUITE_END()
|
||||
|
||||
Reference in New Issue
Block a user