Thrust errors upgrading from CUDA 4.0 to 8.0

122 views Asked by At

I am attempting to upgrade this project (https://github.com/ashwin/gStar4D), which is written in CUDA 4.0 to 8.0. But I am getting a ton of compile errors from Thrust on lines like this:

    thrust::sort_by_key(    orderVec.begin(), orderVec.end(),
                            thrust::make_zip_iterator( make_tuple( _pointVec->begin(), _scaledVec->begin() ) ) );

The errors are typically 'error : class "thrust::tuple_size<>" has no member "value"', 'error : incomplete type is not allowed' or 'error : name followed by "::" must be a class or namespace name'

1>E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/tuple.h(90): error : name followed by "::" must be a class or namespace name
1>                   detected during:
1>                     instantiation of class "thrust::tuple_size<T> [with T=<error-type>]"
1>         (90): here
1>                     instantiation of class "thrust::tuple_size<T> [with T=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/detail/tuple_meta_transform.h(29): here
1>                     processing of template argument list for "thrust::detail::tuple_meta_transform" based on template arguments <std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>, thrust::iterator_reference>
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/detail/zip_iterator_base.h(329): here
1>                     instantiation of class "thrust::detail::zip_iterator_base_ns::tuple_of_iterator_references<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/detail/zip_iterator_base.h(365): here
1>                     instantiation of class "thrust::detail::zip_iterator_base<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/zip_iterator.h(141): here
1>                     instantiation of class "thrust::zip_iterator<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:/testcode/gStar4D-master/GDelaunay/GDelaunay/GDelData.cu(119): here
1>
1>     1>
1>E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/tuple.h(90): error : class "thrust::tuple_size<<error-type>>" has no member "value"
1>                   detected during:
1>                     instantiation of class "thrust::tuple_size<T> [with T=<error-type>]"
1>         (90): here
1>                     instantiation of class "thrust::tuple_size<T> [with T=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/detail/tuple_meta_transform.h(29): here
1>                     processing of template argument list for "thrust::detail::tuple_meta_transform" based on template arguments <std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>, thrust::iterator_reference>
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/detail/zip_iterator_base.h(329): here
1>                     instantiation of class "thrust::detail::zip_iterator_base_ns::tuple_of_iterator_references<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/detail/zip_iterator_base.h(365): here
1>                     instantiation of class "thrust::detail::zip_iterator_base<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/zip_iterator.h(141): here
1>                     instantiation of class "thrust::zip_iterator<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:/testcode/gStar4D-master/GDelaunay/GDelaunay/GDelData.cu(119): here
1>
1>     1>
1>E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/detail/zip_iterator_base.h(326): error : incomplete type is not allowed
1>                   detected during:
1>                     instantiation of class "thrust::detail::zip_iterator_base_ns::tuple_of_iterator_references<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         (365): here
1>                     instantiation of class "thrust::detail::zip_iterator_base<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:\programs\Nvidia GPU Computing Toolkit\CUDA\v8.0\include\thrust/iterator/zip_iterator.h(141): here
1>                     instantiation of class "thrust::zip_iterator<IteratorTuple> [with IteratorTuple=std::tuple<thrust::detail::normal_iterator<thrust::device_ptr<Point3>>, thrust::detail::normal_iterator<thrust::device_ptr<Point3>>>]"
1>         E:/testcode/gStar4D-master/GDelaunay/GDelaunay/GDelData.cu(119): here
1>

Any thoughts on what the issue could be?

1

There are 1 answers

0
griffin2000 On

As Robert suggested above, just needed to add thrust:: to make_tuple:

thrust::sort_by_key(    orderVec.begin(), orderVec.end(),
                        thrust::make_zip_iterator( thrust::make_tuple( _pointVec->begin(), _scaledVec->begin() ) ) );

Just submitted a PR with all the changes necessary to run on Cuda 8.0 here: https://github.com/ashwin/gStar4D/pull/1