lion03 / thrust

Automatically exported from code.google.com/p/thrust
Apache License 2.0
0 stars 0 forks source link

There's no default device dispatch for for_each operation. #192

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
If you use for_each operation with fancy iterators (eg. Counting Iterator) 
theres no default device dispatch. Compilation error:

more than one instance of overloaded function 
"thrust::detail::device::dispatch::for_each" matches the argument list:
1>            function template "void 
thrust::detail::device::dispatch::for_each(InputIterator, InputIterator, 
UnaryFunction, thrust::detail::omp_device_space_tag)"
1>            function template "void 
thrust::detail::device::dispatch::for_each(InputIterator, InputIterator, 
UnaryFunction, thrust::detail::cuda_device_space_tag)"

There is issing code in detail/device/dispatch/for_each.h:
template<typename InputIterator,
         typename UnaryFunction>
  void for_each(InputIterator first,
                InputIterator last,
                UnaryFunction f,
                thrust::any_space_tag)
{
  // Use default backend
  thrust::detail::device::dispatch::for_each(first, last, f, thrust::detail::default_device_space_tag());
}

Original issue reported on code.google.com by sirpiot...@gmail.com on 14 Aug 2010 at 3:46

GoogleCodeExporter commented 8 years ago

Original comment by jaredhoberock on 15 Aug 2010 at 8:57