45 std::size_t
size = 10;
47 std::vector<ScalarType> host_x(size, 1.0);
48 std::vector<ScalarType> host_y(size, 2.0);
50 std::cout <<
"Result on host: ";
51 for (std::size_t i=0; i<
size; ++i)
52 std::cout << host_x[i] + host_y[i] <<
" ";
53 std::cout << std::endl;
65 std::cout <<
"Result with ViennaCL: " << vcl_vec1 << std::endl;
67 std::cout <<
"Data in STL-vector: ";
68 for (std::size_t i=0; i<
size; ++i)
69 std::cout << host_x[i] <<
" ";
70 std::cout << std::endl;
75 std::cout <<
"!!!! TUTORIAL COMPLETED SUCCESSFULLY !!!!" << std::endl;
vcl_size_t size(VectorType const &vec)
Generic routine for obtaining the size of a vector (ViennaCL, uBLAS, etc.)
The vector type with operator-overloads and proxy classes is defined here. Linear algebra operations ...