Skip to content
This repository was archived by the owner on Mar 21, 2024. It is now read-only.

thrust::copy between cusp::complex and std::complex fails (cuda 5.5, thrust 1.7) #392

Closed
kaatish opened this issue Aug 23, 2013 · 1 comment · Fixed by #395
Closed

thrust::copy between cusp::complex and std::complex fails (cuda 5.5, thrust 1.7) #392

kaatish opened this issue Aug 23, 2013 · 1 comment · Fixed by #395

Comments

@kaatish
Copy link
Collaborator

kaatish commented Aug 23, 2013

The following code has stopped working since installation of cuda 5.5.

#include <vector>
#include <cusp/complex.h>
#include <thrust/device_vector.h>
#include <thrust/copy.h>
#include <complex>
int main(int argc, char *argv[])
{
thrust::device_vector<cusp::complex<float> > temp(10,1);
std::vector<std::complex<float> > htemp(temp.size());
thrust::copy(temp.begin(), temp.end(), htemp.begin());
return 0;
}

Is this intended?

The error output is

/usr/local/cuda-5.5/bin/..//include/thrust/system/detail/internal/scalar/general_copy.h(43): error: no operator "=" matches these operands
            operand types are: std::complex<float> = thrust::reference<cusp::complex<float>, thrust::pointer<cusp::complex<float>, thrust::system::cpp::detail::tag, thrust::use_default, thrust::use_default>, thrust::use_default>
          detected during:
            instantiation of "OutputIterator thrust::system::detail::internal::scalar::general_copy(InputIterator, InputIterator, OutputIterator) [with InputIterator=thrust::detail::normal_iterator<thrust::pointer<cusp::complex<float>, thrust::system::cpp::detail::tag, thrust::use_default, thrust::use_default>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/system/detail/internal/scalar/copy.inl(69): here
            instantiation of "OutputIterator thrust::system::detail::internal::scalar::copy_detail::copy(InputIterator, InputIterator, OutputIterator, thrust::detail::false_type) [with InputIterator=thrust::detail::normal_iterator<thrust::pointer<cusp::complex<float>, thrust::system::cpp::detail::tag, thrust::use_default, thrust::use_default>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/system/detail/internal/scalar/copy.inl(107): here
            instantiation of "OutputIterator thrust::system::detail::internal::scalar::copy(InputIterator, InputIterator, OutputIterator) [with InputIterator=thrust::detail::normal_iterator<thrust::pointer<cusp::complex<float>, thrust::system::cpp::detail::tag, thrust::use_default, thrust::use_default>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/system/cpp/detail/copy.h(43): here
            instantiation of "OutputIterator thrust::system::cpp::detail::copy(thrust::system::cpp::detail::tag, InputIterator, InputIterator, OutputIterator) [with InputIterator=thrust::detail::normal_iterator<thrust::pointer<cusp::complex<float>, thrust::system::cpp::detail::tag, thrust::use_default, thrust::use_default>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/detail/copy.inl(35): here
            instantiation of "OutputIterator thrust::copy(const thrust::detail::execution_policy_base<System> &, InputIterator, InputIterator, OutputIterator) [with System=thrust::system::cpp::detail::tag, InputIterator=thrust::detail::normal_iterator<thrust::pointer<cusp::complex<float>, thrust::system::cpp::detail::tag, thrust::use_default, thrust::use_default>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/system/cuda/detail/copy_cross_system.inl(207): here
            [ 3 instantiation contexts not shown ]
            instantiation of "OutputIterator thrust::system::cuda::detail::copy_cross_system(thrust::system::cuda::detail::cross_system<System1, System2>, InputIterator, InputIterator, OutputIterator) [with System1=thrust::system::cuda::detail::tag, System2=thrust::system::cpp::detail::tag, InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<cusp::complex<float>>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/system/cuda/detail/copy.inl(53): here
            instantiation of "OutputIterator thrust::system::cuda::detail::copy(thrust::system::cuda::detail::cross_system<System1, System2>, InputIterator, InputIterator, OutputIterator) [with System1=thrust::system::cuda::detail::tag, System2=thrust::system::cpp::detail::tag, InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<cusp::complex<float>>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/detail/copy.inl(35): here
            instantiation of "OutputIterator thrust::copy(const thrust::detail::execution_policy_base<System> &, InputIterator, InputIterator, OutputIterator) [with System=thrust::system::cuda::detail::cross_system<thrust::system::cuda::detail::tag, thrust::system::cpp::detail::tag>, InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<cusp::complex<float>>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/detail/copy.inl(66): here
            instantiation of "OutputIterator thrust::detail::two_system_copy(thrust::execution_policy<FromSystem> &, thrust::execution_policy<ToSystem> &, InputIterator, InputIterator, OutputIterator) [with FromSystem=thrust::system::cuda::detail::tag, ToSystem=thrust::system::cpp::detail::tag, InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<cusp::complex<float>>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
/usr/local/cuda-5.5/bin/..//include/thrust/detail/copy.inl(102): here
            instantiation of "OutputIterator thrust::copy(InputIterator, InputIterator, OutputIterator) [with InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<cusp::complex<float>>>, OutputIterator=__gnu_cxx::__normal_iterator<std::complex<float> *, std::vector<std::complex<float>, std::allocator<std::complex<float>>>>]" 
test.cu(10): here

1 error detected in the compilation of "/tmp/tmpxft_00002dda_00000000-6_test.cpp1.ii".
jaredhoberock added a commit to jaredhoberock/thrust that referenced this issue Aug 23, 2013
that assignments from wrapped references to an OutputIterator with
a related reference will succeed.

Fixes NVIDIA#392
@jaredhoberock
Copy link
Contributor

Thanks for the report, should be fixed now!

kshitij12345 pushed a commit to kshitij12345/thrust that referenced this issue Mar 24, 2022
Update header tests to check for termios.h's B0 macro.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants