We can initilize the device array with many threads, but it seems this is not supproted by ViennaCL. So i want to copy the device array to a viennacl vector.
how to resovle this.
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi p ding,
Which backend are you targeting? In either case, you can wrap your existing buffers by a viennacl::vector<>, which would be a zero-copy operation :-)
Here is an example on how to wrap a user-provided CUDA buffer: https://github.com/viennacl/viennacl-dev/blob/master/examples/tutorial/custom-cuda.cu
(this can be done similarly for OpenCL and OpenMP)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
We can initilize the device array with many threads, but it seems this is not supproted by ViennaCL. So i want to copy the device array to a viennacl vector.
how to resovle this.
Hi p ding,
Which backend are you targeting? In either case, you can wrap your existing buffers by a viennacl::vector<>, which would be a zero-copy operation :-)
Here is an example on how to wrap a user-provided CUDA buffer: https://github.com/viennacl/viennacl-dev/blob/master/examples/tutorial/custom-cuda.cu
(this can be done similarly for OpenCL and OpenMP)
Thanks , it works for my problems.