dynVCLVec(viennacl::matrix_range<viennacl::matrix<T> > &mat, const int ctx_id) { viennacl::context ctx; // explicitly pull context for thread safe forking ctx = viennacl::context(viennacl::ocl::get_context(static_cast<long>(ctx_id))); viennacl::vector_base<T> A = viennacl::vector_base<T>(mat.size1() * mat.size2(), ctx); viennacl::matrix_base<T> dummy(A.handle(), mat.size1(), 0, 1, mat.size1(), //row layout mat.size2(), 0, 1, mat.size2(), //column layout true); // row-major dummy = mat; // shared = true; size = A.size(); begin = 1; last = size; // ptr = &A; viennacl::range temp_r(0, size); r = temp_r; shared = false; shared_type = 0; shptr = std::make_shared<viennacl::vector_base<T> >(A); }
vcl_size_t internal_size2(viennacl::matrix_range<MatrixType> const & mat) { return internal_size2(mat.get()); }
typename result_of::size_type<MatrixType>::type internal_size2(viennacl::matrix_range<MatrixType> const & mat) { return mat.get().internal_size2(); }