28 #ifndef REMORA_KERNELS_CLBLAS_VECTOR_ASSIGN_HPP 29 #define REMORA_KERNELS_CLBLAS_VECTOR_ASSIGN_HPP 31 #include "../../expression_types.hpp" 32 #include "../../detail/traits.hpp" 33 #include <boost/compute/iterator/zip_iterator.hpp> 34 #include <boost/compute/algorithm/copy.hpp> 35 #include <boost/compute/algorithm/transform.hpp> 36 #include <boost/compute/functional/bind.hpp> 38 namespace remora{
namespace bindings{
40 template<
class F,
class V>
41 void assign(vector_expression<V, gpu_tag>& v,
typename V::value_type t) {
42 auto unary = boost::compute::bind(F(),boost::compute::placeholders::_1, t);
51 template<
class V,
class E>
53 vector_expression<V, gpu_tag>& v, vector_expression<E, gpu_tag>
const& e,
56 boost::compute::copy(e().begin(),e().end(), v().begin(), v().queue());
65 template<
class V,
class E,
class F>
66 void vector_assign_functor(
67 vector_expression<V, gpu_tag>& v,
68 vector_expression<E, gpu_tag>
const& e,
72 auto zip_begin = boost::compute::make_zip_iterator(boost::make_tuple(v().begin(), e().begin()));
73 auto zip_end = boost::compute::make_zip_iterator(boost::make_tuple(v().end(), e().end()));