this is my code
a definition of the zip-iterator
`using namespace std;
typedef thrust::device_vector<unsigned int>::iterator IntIterator;
typedef thrust::device_vector<float>::iterator FloatIterator;
typedef thrust::tuple<IntIterator, FloatIterator> IteratorTuple;
typedef thrust::zip_iterator<IteratorTuple> ZipIterator;`
a difintion of the pred
struct is_less_than_zero_zip
{
__host__ __device__
bool operator()(ZipIterator & x)
{
return thrust::get<0>(x[0]) <= 5.0;
}
};
main function start
int main(void)
{
const int N=10;
vector defintion
thrust::host_vector<unsigned int> h_values;
h_values = thrust::host_vector<unsigned int>(N);
thrust::sequence(h_values.begin(), h_values.end());
thrust::device_vector<unsigned int> d_values;
d_values = h_values;
thrust::device_vector<float> d_keys;
d_keys=h_keys;
ZipIterator iter(thrust::make_tuple(d_values.begin(), d_keys.begin()));
the question is how to delimit my pred
is_less_than_zero_zip pred;
thrust::remove_if(iter,iter+N,pred);
return 0;
}