mirror of
https://github.com/boostorg/compute.git
synced 2026-02-19 02:12:19 +00:00
Move is_device_iterator to the public API
This commit is contained in:
@@ -19,7 +19,7 @@
|
||||
#include <boost/compute/algorithm/copy.hpp>
|
||||
#include <boost/compute/algorithm/reverse.hpp>
|
||||
#include <boost/compute/container/vector.hpp>
|
||||
#include <boost/compute/iterator/constant_iterator.hpp>
|
||||
#include <boost/compute/iterator/buffer_iterator.hpp>
|
||||
|
||||
#include "check_macros.hpp"
|
||||
#include "context_setup.hpp"
|
||||
|
||||
@@ -49,6 +49,19 @@ BOOST_AUTO_TEST_CASE(value_type)
|
||||
));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(base_type)
|
||||
{
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<
|
||||
boost::compute::permutation_iterator<
|
||||
boost::compute::buffer_iterator<int>,
|
||||
boost::compute::buffer_iterator<int>
|
||||
>::base_type,
|
||||
boost::compute::buffer_iterator<int>
|
||||
>::value
|
||||
));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy)
|
||||
{
|
||||
int input_data[] = { 3, 4, 2, 1, 5 };
|
||||
|
||||
@@ -50,6 +50,18 @@ BOOST_AUTO_TEST_CASE(value_type)
|
||||
));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(base_type)
|
||||
{
|
||||
BOOST_STATIC_ASSERT((
|
||||
boost::is_same<
|
||||
boost::compute::transform_iterator<
|
||||
boost::compute::buffer_iterator<int>, boost::compute::abs<int>
|
||||
>::base_type,
|
||||
boost::compute::buffer_iterator<int>
|
||||
>::value
|
||||
));
|
||||
}
|
||||
|
||||
BOOST_AUTO_TEST_CASE(copy)
|
||||
{
|
||||
int data[] = { 1, -2, 3, -4, 5 };
|
||||
|
||||
@@ -24,7 +24,6 @@
|
||||
#include <boost/compute/iterator/constant_iterator.hpp>
|
||||
#include <boost/compute/detail/is_buffer_iterator.hpp>
|
||||
#include <boost/compute/detail/is_contiguous_iterator.hpp>
|
||||
#include <boost/compute/detail/is_device_iterator.hpp>
|
||||
|
||||
namespace bc = boost::compute;
|
||||
|
||||
@@ -119,10 +118,14 @@ BOOST_AUTO_TEST_CASE(is_buffer_iterator)
|
||||
|
||||
BOOST_AUTO_TEST_CASE(is_device_iterator)
|
||||
{
|
||||
using boost::compute::detail::is_device_iterator;
|
||||
using boost::compute::is_device_iterator;
|
||||
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<boost::compute::buffer_iterator<int> >::value == true);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<const boost::compute::buffer_iterator<int> >::value == true);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<boost::compute::constant_iterator<int> >::value == true);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<std::vector<int>::iterator>::value == false);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<const boost::compute::constant_iterator<int> >::value == true);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<float *>::value == false);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<const float *>::value == false);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<std::vector<int>::iterator>::value == false);
|
||||
BOOST_STATIC_ASSERT(is_device_iterator<const std::vector<int>::iterator>::value == false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user