[Trilinos-Users] Kokkos/thrust compilation issue

ryuuta ryuuta at gmail.com
Thu Feb 24 21:04:03 MST 2011


Hi,

I bet it's already addressed internally, but let me post it anyway.
During the compilation of ThrustGPUNodeTest.cpp, I got:

[ 19%] Building CXX object
packages/kokkos/NodeAPI/test/CMakeFiles/Kokkos_ThrustGPUNodeTestAndTiming.dir/ThrustGPUNodeTest.cpp.o
...
/home/ryuta/packages/trilinos/src/trilinos-10.6.2-Source/packages/kokkos/NodeAPI/test/ThrustGPUNodeTest.cpp:36:40:
  instantiated from here
/usr/include/cuda/thrust/detail/device/cuda/for_each.inl:93:1: error:
invalid application of ‘sizeof’ to incomplete type
‘thrust::detail::STATIC_ASSERTION_FAILURE<false>’
/usr/include/cuda/thrust/detail/device/cuda/for_each.inl: In function
‘RandomAccessIterator
thrust::detail::device::cuda::for_each_n(RandomAccessIterator, Size,
UnaryFunction) [with RandomAccessIterator =
thrust::detail::normal_iterator<thrust::device_ptr<int> >, Size = int,
UnaryFunction =
thrust::detail::generate_functor<thrust::detail::fill_functor<int> >]’:
/usr/include/cuda/thrust/detail/device/dispatch/for_each.h:56:62:
instantiated from ‘RandomAccessIterator
thrust::detail::device::dispatch::for_each_n(RandomAccessIterator, Size,
UnaryFunction, thrust::detail::cuda_device_space_tag) [with
RandomAccessIterator =
thrust::detail::normal_iterator<thrust::device_ptr<int> >, Size = int,
UnaryFunction =
thrust::detail::generate_functor<thrust::detail::fill_functor<int> >]’
/usr/include/cuda/thrust/detail/device/for_each.inl:43:62:   instantiated
from ‘OutputIterator thrust::detail::device::for_each_n(OutputIterator,
Size, UnaryFunction) [with OutputIterator =
thrust::detail::normal_iterator<thrust::device_ptr<int> >, Size = int,
UnaryFunction =
thrust::detail::generate_functor<thrust::detail::fill_functor<int> >]’
/usr/include/cuda/thrust/detail/dispatch/for_each.h:84:56:   instantiated
from ‘OutputIterator thrust::detail::dispatch::for_each_n(OutputIterator,
Size, UnaryFunction, thrust::device_space_tag) [with OutputIterator =
thrust::detail::normal_iterator<thrust::device_ptr<int> >, Size = int,
UnaryFunction =
thrust::detail::generate_functor<thrust::detail::fill_functor<int> >]’
/usr/include/cuda/thrust/detail/for_each.inl:41:66:   instantiated from
‘OutputIterator thrust::detail::for_each_n(OutputIterator, Size,
UnaryFunction) [with OutputIterator =
thrust::detail::normal_iterator<thrust::device_ptr<int> >, Size = int,
UnaryFunction =
thrust::detail::generate_functor<thrust::detail::fill_functor<int> >]’
/usr/include/cuda/thrust/detail/generate.inl:47:79:   instantiated from
‘OutputIterator thrust::generate_n(OutputIterator, Size, Generator) [with
OutputIterator = thrust::detail::normal_iterator<thrust::device_ptr<int> >,
Size = int, Generator = thrust::detail::fill_functor<int>]’
/usr/include/cuda/thrust/detail/device/cuda/fill.inl:87:43:   [ skipping 8
instantiation contexts ]
/usr/include/cuda/thrust/detail/dispatch/uninitialized_fill.h:47:3:
instantiated from ‘void
thrust::detail::dispatch::uninitialized_fill(ForwardIterator,
ForwardIterator, const T&, thrust::detail::true_type) [with ForwardIterator
= thrust::detail::normal_iterator<thrust::device_ptr<int> >, T = int,
thrust::detail::true_type = thrust::detail::integral_constant<bool, true>]’
/usr/include/cuda/thrust/detail/uninitialized_fill.inl:40:3:   instantiated
from ‘void thrust::uninitialized_fill(ForwardIterator, ForwardIterator,
const T&) [with ForwardIterator =
thrust::detail::normal_iterator<thrust::device_ptr<int> >, T = int]’
/usr/include/cuda/thrust/detail/vector_base.inl:154:5:   instantiated from
‘void thrust::detail::vector_base<T,
Alloc>::fill_init(thrust::detail::vector_base<T, Alloc>::size_type, const
T&) [with T = int, Alloc = thrust::device_malloc_allocator<int>,
thrust::detail::vector_base<T, Alloc>::size_type = unsigned int]’
/usr/include/cuda/thrust/detail/vector_base.inl:62:3:   instantiated from
‘thrust::detail::vector_base<T,
Alloc>::vector_base(thrust::detail::vector_base<T, Alloc>::size_type,
thrust::detail::vector_base<T, Alloc>::value_type&) [with T = int, Alloc =
thrust::device_malloc_allocator<int>, thrust::detail::vector_base<T,
Alloc>::size_type = unsigned int, thrust::detail::vector_base<T,
Alloc>::value_type = int]’
/usr/include/cuda/thrust/device_vector.h:77:22:   instantiated from
‘thrust::device_vector<T, Alloc>::device_vector(thrust::device_vector<T,
Alloc>::size_type, thrust::device_vector<T, Alloc>::value_type&) [with T =
int, Alloc = thrust::device_malloc_allocator<int>, thrust::device_vector<T,
Alloc>::size_type = unsigned int, thrust::device_vector<T,
Alloc>::value_type = int]’
...

The development version of thrust is equipped with the static assertion to
make sure
thrust with cuda backend is compiled nvcc. Please see
/usr/include/cuda/thrust/detail/device/cuda/for_each.inl in lines 88-93, for
example.

Regards,

Ryuta
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://software.sandia.gov/pipermail/trilinos-users/attachments/20110225/639691fc/attachment-0001.html 


More information about the Trilinos-Users mailing list