-
Notifications
You must be signed in to change notification settings - Fork 756
How to initilize thrust device vector from another device vector declared by cuda #1833
Comments
I am not fully sure what you mean with However, you could always use one of the algorithms such like https://github.com/NVIDIA/thrust/blob/main/thrust/fill.h |
I mean fill thrust vector with d_b from the 80'th to the 100'th values. |
In that case you would need to use Lines 118 to 130 in 125d281
|
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); |
this can work for u:
int main() |
I have a device vector d_b[100], I want to creat a thrust vector with d_b[80:100]. How to resolve this mission.
The text was updated successfully, but these errors were encountered: