Briefly, I want to copy elements in vector A to vector B, if the value of the same index element in vector C is 1. My code like the following.
thrust::device_ptr<int> A(d_a), B(d_b), C(d_c);
auto lambda = [&] __host__ __device__ (const int idx) {
return C[idx] == 1;
};
thrust::copy_if(A, A + N, B, lambda);
The compiler error with this message
error: a variable captured by a lambda cannot have a type involving a variable-length array
Is it possible to pass device vector to lambda? and how?
Thank you