// Create vector of the specified size. static boost::shared_ptr<vector> create_vector(size_t size, const params &prm) { precondition(!prm.context().empty(), "Empty VexCL context!"); return boost::make_shared<vector>(prm.context(), size); }
// Copy vector from builtin backend. static boost::shared_ptr<vector> copy_vector(typename builtin<real>::vector const &x, const params &prm) { precondition(!prm.context().empty(), "Empty VexCL context!"); return boost::make_shared<vector>(prm.context(), x); }
// Copy matrix from builtin backend. static boost::shared_ptr<matrix> copy_matrix(boost::shared_ptr< typename builtin<real>::matrix > A, const params &prm) { precondition(!prm.context().empty(), "Empty VexCL context!"); const typename builtin<real>::matrix &a = *A; BOOST_AUTO(Aptr, a.ptr_data()); BOOST_AUTO(Acol, a.col_data()); BOOST_AUTO(Aval, a.val_data()); return boost::make_shared<matrix>(prm.context(), rows(*A), cols(*A), Aptr, Acol, Aval); }
lemon_interface(const params &p) { state_ = ::ParseAlloc(&pooled::tracked_byte_alloc); if (p.trace()) { #if NERVE_TRACE_PARSER ::ParseTrace(stdout, detail::parse_trace_prefix); #endif } context_ = p.context(); }
scatter(size_t size, const std::vector<ptrdiff_t> &I, const params &prm) : S(prm.context(), size, std::vector<size_t>(I.begin(), I.end())) , tmp(I.size()) { }
gather(size_t src_size, const std::vector<ptrdiff_t> &I, const params &prm) : G(prm.context(), src_size, std::vector<size_t>(I.begin(), I.end())) { }