Menu

how to set the values of viennacl_vector with another device array.

p ding
2019-04-11
2019-04-12
  • p ding

    p ding - 2019-04-11

    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.

     
  • Karl Rupp

    Karl Rupp - 2019-04-11

    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)

     
  • p ding

    p ding - 2019-04-12

    Thanks , it works for my problems.

     

Log in to post a comment.