Hey Guys,
I’m going to post what works and what doesn’t work and I’m curious as to exactly why I need a typedef to make my code compile.
typedef thrust::device_vector<unsigned>::iterator uint_iter;
typedef thrust::tuple<uint_iter, uint_iter> uint_tuple_iter;
void heart(
thrust::device_vector<point> &points,
thrust::device_vector<tetra> &tetras,
thrust::device_vector<unsigned> &t_association,
thrust::device_vector<unsigned> &p_association
)
{
unsigned *t_assoc = thrust::raw_pointer_cast(t_association.data());
unsigned *p_assoc = thrust::raw_pointer_cast(p_association.data());
thrust::zip_iterator<uint_tuple_iter> ptet_pair =
thrust::make_zip_iterator(
thrust::make_tuple(t_association.begin(),
p_association.begin()));
/* ... */
}
The above code compiles and works properly.
But why doesn’t using this instead work?
thrust::zip_iterator<thrust::tuple<thrust::device_vector<unsigned>::iterator, thrust::device_vector<unsigned>::iterator>> ptet_pair =
thrust::make_zip_iterator(
thrust::make_tuple(t_association.begin(),
p_association.begin()));
Why do I seem to need a typedef? Is this just a weird template programming thing?