Skip to content

How to initilize thrust device vector from another device vector declared by cuda #1038

Answered by pauleonix
ztdepztdep asked this question in Thrust
Discussion options

You must be logged in to vote

If possibe, I would rather just use the right constructor to avoid unnecessary initialisation, i.e.

thrust::device_vector<float> d_c(d_b.cbegin() + 80, d_b.cend());
// or
thrust::device_vector<float> d_c(d_b.cbegin() + 80, d_b.cbegin() + 100);

Replies: 0 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by jrhemstad
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Thrust
Labels
thrust For all items related to Thrust.
4 participants