Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build Error with CUDA in VS2015 x64 #70

Closed
johnxcutor opened this issue Mar 24, 2018 · 6 comments
Closed

Build Error with CUDA in VS2015 x64 #70

johnxcutor opened this issue Mar 24, 2018 · 6 comments

Comments

@johnxcutor
Copy link

johnxcutor commented Mar 24, 2018

Hi,

When I build program with CUDA, it shows a error below:

1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/system/cuda/detail/internal/copy_cross_system.h(251): error C2664: 'OutputIt thrust::cuda_cub::__copy::cross_system_copy_n<thrust::cuda_cub::tag,Derived,InputIt,Size,OutputIt>(thrust::execution_policy<thrust::cuda_cub::tag> &,thrust::execution_policy<Derived> &,InputIt,Size,OutputIt,thrust::detail::true_type)': cannot convert argument 6 from 'thrust::detail::integral_constant<bool,false>' to 'thrust::detail::true_type'

I'm using solver.cpp and everything is OK without CUDA. I have tried 1.1.0 and the master, all get this error. Do I need to add more settings to run with GPU?

Thanks & Regards,

John

@ddemidov
Copy link
Owner

There should be more to the error, can you post the full compiler output (so that we can pinpoint the place in amgcl code which lead to the error)? Also, I don't have any problems compiling solver_cuda with CUDA 9.1, but that is on a linux system.

@johnxcutor
Copy link
Author

johnxcutor commented Mar 24, 2018

Below is the output for your reference:

1>------ Build started: Project: gosolve, Configuration: Release x64 ------
1>  gosolve.cpp
1>D:\dev\cpp\all_src\amgcl-master\amgcl/backend/cuda.hpp(228): warning C4267: 'argument': conversion from 'size_t' to 'int', possible loss of data
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/backend/cuda.hpp(223): note: while compiling class template member function 'void amgcl::backend::cuda_hyb_matrix<real>::fill_matrix(std::size_t,std::size_t,const ptrdiff_t *,const ptrdiff_t *,const double *)'
1>          with
1>          [
1>              real=double
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/backend/cuda.hpp(144): note: see reference to function template instantiation 'void amgcl::backend::cuda_hyb_matrix<real>::fill_matrix(std::size_t,std::size_t,const ptrdiff_t *,const ptrdiff_t *,const double *)' being compiled
1>          with
1>          [
1>              real=double
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/preconditioner/dummy.hpp(87): note: see reference to class template instantiation 'amgcl::backend::cuda_hyb_matrix<real>' being compiled
1>          with
1>          [
1>              real=double
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/preconditioner/dummy.hpp(86): note: while compiling class template member function 'const amgcl::backend::cuda_hyb_matrix<real> &amgcl::preconditioner::dummy<Backend>::system_matrix(void) const'
1>          with
1>          [
1>              real=double,
1>              Backend=Backend
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/preconditioner/dummy.hpp(94): note: see reference to function template instantiation 'const amgcl::backend::cuda_hyb_matrix<real> &amgcl::preconditioner::dummy<Backend>::system_matrix(void) const' being compiled
1>          with
1>          [
1>              real=double,
1>              Backend=Backend
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/preconditioner/runtime.hpp(319): note: see reference to class template instantiation 'amgcl::preconditioner::dummy<Backend>' being compiled
1>          with
1>          [
1>              Backend=Backend
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/preconditioner/runtime.hpp(295): note: while compiling class template member function 'std::ostream &amgcl::runtime::operator <<(std::ostream &,const amgcl::runtime::preconditioner<Backend> &)'
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/make_solver.hpp(46): note: see reference to class template instantiation 'amgcl::runtime::preconditioner<Backend>' being compiled
1>  d:\dev\cpp\test_code\gosolve\testamgsolver.hpp(457): note: see reference to class template instantiation 'amgcl::make_solver<amgcl::runtime::preconditioner<Backend>,amgcl::runtime::iterative_solver<Backend,amgcl::solver::detail::default_inner_product>>' being compiled
1>  gosolve.cpp(168): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> solve_bicgstab<amgcl::runtime::preconditioner>(const boost::property_tree::ptree &,std::size_t,const std::vector<ptrdiff_t,std::allocator<_Ty>> &,const std::vector<_Ty,std::allocator<_Ty>> &,const std::vector<double,std::allocator<double>> &,const std::vector<double,std::allocator<double>> &,std::vector<double,std::allocator<double>> &,bool)' being compiled
1>          with
1>          [
1>              _Ty=ptrdiff_t
1>          ]
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(54): note: see reference to class template instantiation 'boost::arg<9>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(53): note: see reference to class template instantiation 'boost::arg<8>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(52): note: see reference to class template instantiation 'boost::arg<7>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(51): note: see reference to class template instantiation 'boost::arg<6>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(50): note: see reference to class template instantiation 'boost::arg<5>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(49): note: see reference to class template instantiation 'boost::arg<4>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(48): note: see reference to class template instantiation 'boost::arg<3>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(47): note: see reference to class template instantiation 'boost::arg<2>' being compiled
1>  D:\dev\boost_1_64_0\boost/bind/placeholders.hpp(46): note: see reference to class template instantiation 'boost::arg<1>' being compiled
1>D:\dev\cpp\all_src\amgcl-master\amgcl/solver/bicgstabl.hpp(317): warning C4244: 'argument': conversion from 'const __int64' to 'int', possible loss of data
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/runtime.hpp(716): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::solver::bicgstabl<Backend,InnerProduct>::operator ()<Matrix,Precond,Vec1,T&>(const Matrix &,const Precond &,const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              Backend=Backend,
1>              InnerProduct=amgcl::solver::detail::default_inner_product,
1>              Matrix=amgcl::backend::cuda_hyb_matrix<double>,
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/runtime.hpp(715): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::solver::bicgstabl<Backend,InnerProduct>::operator ()<Matrix,Precond,Vec1,T&>(const Matrix &,const Precond &,const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              Backend=Backend,
1>              InnerProduct=amgcl::solver::detail::default_inner_product,
1>              Matrix=amgcl::backend::cuda_hyb_matrix<double>,
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/runtime.hpp(609): note: see reference to function template instantiation 'void amgcl::runtime::detail::solver_solve<amgcl::backend::cuda<double,amgcl::solver::cuda_skyline_lu<real>>,Matrix,Precond,Vec1,Vec2>::process<Solver>(void) const' being compiled
1>          with
1>          [
1>              real=double,
1>              Matrix=amgcl::backend::cuda_hyb_matrix<double>,
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/runtime.hpp(609): note: see reference to function template instantiation 'void amgcl::runtime::detail::solver_solve<amgcl::backend::cuda<double,amgcl::solver::cuda_skyline_lu<real>>,Matrix,Precond,Vec1,Vec2>::process<Solver>(void) const' being compiled
1>          with
1>          [
1>              real=double,
1>              Matrix=amgcl::backend::cuda_hyb_matrix<double>,
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/runtime.hpp(812): note: see reference to function template instantiation 'void amgcl::runtime::detail::process_solver<Backend,InnerProduct,amgcl::runtime::detail::solver_solve<Backend,Matrix,Precond,Vec1,Vec2>>(amgcl::runtime::solver::type,const Func &)' being compiled
1>          with
1>          [
1>              Backend=Backend,
1>              InnerProduct=amgcl::solver::detail::default_inner_product,
1>              Matrix=amgcl::backend::cuda_hyb_matrix<double>,
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &,
1>              Func=amgcl::runtime::detail::solver_solve<amgcl::backend::cuda<double,amgcl::solver::cuda_skyline_lu<double>>,amgcl::backend::cuda_hyb_matrix<double>,amgcl::runtime::preconditioner<Backend>,thrust::device_vector<double,thrust::device_malloc_allocator<double>>,thrust::device_vector<double,thrust::device_malloc_allocator<double>> &>
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/runtime.hpp(835): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::runtime::iterative_solver<Backend,amgcl::solver::detail::default_inner_product>::operator ()<amgcl::backend::cuda_hyb_matrix<real>,Precond,Vec1,T&>(const Matrix &,const Precond &,const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              real=double,
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Matrix=amgcl::backend::cuda_hyb_matrix<double>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/runtime.hpp(835): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::runtime::iterative_solver<Backend,amgcl::solver::detail::default_inner_product>::operator ()<amgcl::backend::cuda_hyb_matrix<real>,Precond,Vec1,T&>(const Matrix &,const Precond &,const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              real=double,
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Matrix=amgcl::backend::cuda_hyb_matrix<double>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/make_solver.hpp(157): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::runtime::iterative_solver<Backend,amgcl::solver::detail::default_inner_product>::operator ()<Precond,Vec1,T&>(const Precond &,const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  D:\dev\cpp\all_src\amgcl-master\amgcl/make_solver.hpp(157): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::runtime::iterative_solver<Backend,amgcl::solver::detail::default_inner_product>::operator ()<Precond,Vec1,T&>(const Precond &,const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              Precond=amgcl::runtime::preconditioner<Backend>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  d:\dev\cpp\test_code\gosolve\testamgsolver.hpp(471): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::make_solver<amgcl::runtime::preconditioner<Backend>,amgcl::runtime::iterative_solver<Backend,amgcl::solver::detail::default_inner_product>>::operator ()<T,T&>(const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>  d:\dev\cpp\test_code\gosolve\testamgsolver.hpp(471): note: see reference to function template instantiation 'boost::tuples::tuple<std::size_t,double,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type,boost::tuples::null_type> amgcl::make_solver<amgcl::runtime::preconditioner<Backend>,amgcl::runtime::iterative_solver<Backend,amgcl::solver::detail::default_inner_product>>::operator ()<T,T&>(const Vec1 &,Vec2) const' being compiled
1>          with
1>          [
1>              T=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec1=thrust::device_vector<double,thrust::device_malloc_allocator<double>>,
1>              Vec2=thrust::device_vector<double,thrust::device_malloc_allocator<double>> &
1>          ]
1>D:\dev\cpp\all_src\amgcl-master\amgcl/solver/bicgstabl.hpp(322): warning C4244: 'argument': conversion from 'const __int64' to 'int', possible loss of data
1>D:\dev\cpp\all_src\amgcl-master\amgcl/solver/bicgstabl.hpp(327): warning C4244: 'argument': conversion from 'const __int64' to 'int', possible loss of data
1>C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/system/cuda/detail/internal/copy_cross_system.h(251): error C2664: 'OutputIt thrust::cuda_cub::__copy::cross_system_copy_n<thrust::cuda_cub::tag,Derived,InputIt,Size,OutputIt>(thrust::execution_policy<thrust::cuda_cub::tag> &,thrust::execution_policy<Derived> &,InputIt,Size,OutputIt,thrust::detail::true_type)': cannot convert argument 6 from 'thrust::detail::integral_constant<bool,false>' to 'thrust::detail::true_type'
1>          with
1>          [
1>              OutputIt=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              Derived=thrust::system::cpp::detail::tag,
1>              InputIt=thrust::detail::normal_iterator<thrust::device_ptr<double>>,
1>              Size=__int64
1>          ]
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/system/cuda/detail/internal/copy_cross_system.h(251): note: No user-defined-conversion operator available that can perform this conversion, or the operator cannot be called
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/system/cuda/detail/internal/copy_cross_system.h(267): note: see reference to function template instantiation 'OutputIt thrust::cuda_cub::__copy::cross_system_copy_n<thrust::cuda_cub::tag,thrust::system::cpp::detail::tag,InputIterator,__int64,OutputIterator>(thrust::cuda_cub::cross_system<thrust::cuda_cub::tag,thrust::system::cpp::detail::tag>,InputIt,Size,OutputIt)' being compiled
1>          with
1>          [
1>              OutputIt=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<double>>,
1>              OutputIterator=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              InputIt=thrust::detail::normal_iterator<thrust::device_ptr<double>>,
1>              Size=__int64
1>          ]
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/system/cuda/detail/copy.h(174): note: see reference to function template instantiation 'OutputIterator thrust::cuda_cub::__copy::cross_system_copy<thrust::cuda_cub::tag,thrust::system::cpp::detail::tag,InputIterator,OutputIterator>(thrust::cuda_cub::cross_system<thrust::cuda_cub::tag,thrust::system::cpp::detail::tag>,InputIterator,InputIterator,OutputIterator)' being compiled
1>          with
1>          [
1>              OutputIterator=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<double>>
1>          ]
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/detail/copy.inl(37): note: see reference to function template instantiation 'OutputIterator thrust::cuda_cub::copy<thrust::cuda_cub::tag,thrust::system::cpp::detail::tag,InputIterator,OutputIterator>(thrust::cuda_cub::cross_system<thrust::cuda_cub::tag,thrust::system::cpp::detail::tag>,InputIterator,InputIterator,OutputIterator)' being compiled
1>          with
1>          [
1>              OutputIterator=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<double>>
1>          ]
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/detail/copy.inl(72): note: see reference to function template instantiation 'OutputIterator thrust::copy<DerivedPolicy,InputIterator,OutputIterator>(const thrust::detail::execution_policy_base<DerivedPolicy> &,InputIterator,InputIterator,OutputIterator)' being compiled
1>          with
1>          [
1>              OutputIterator=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              DerivedPolicy=thrust::cuda_cub::cross_system<thrust::cuda_cub::tag,thrust::system::cpp::detail::tag>,
1>              InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<double>>
1>          ]
1>  C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include\thrust/detail/copy.inl(110): note: see reference to function template instantiation 'OutputIterator thrust::detail::two_system_copy<thrust::cuda_cub::tag,Derived,InputIterator,OutputIterator>(const thrust::execution_policy<thrust::cuda_cub::tag> &,const thrust::execution_policy<Derived> &,InputIterator,InputIterator,OutputIterator)' being compiled
1>          with
1>          [
1>              OutputIterator=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              Derived=thrust::system::cpp::detail::tag,
1>              InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<double>>
1>          ]
1>  d:\dev\cpp\test_code\gosolve\testamgsolver.hpp(479): note: see reference to function template instantiation 'OutputIterator thrust::copy<thrust::detail::normal_iterator<thrust::device_ptr<T>>,std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>>(InputIterator,InputIterator,OutputIterator)' being compiled
1>          with
1>          [
1>              OutputIterator=std::_Vector_iterator<std::_Vector_val<std::_Simple_types<double>>>,
1>              T=double,
1>              InputIterator=thrust::detail::normal_iterator<thrust::device_ptr<double>>
1>          ]
1>  testSolver.cpp
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

@ddemidov
Copy link
Owner

It seems you have the main code in testSolver.cpp. CUDA code should be in .cu files instead. Can you try to rename the file to testSolver.cu and see if it helps? In amgcl examples the solver.cpp is copied into solver.cu in order to compile examples/solver_cuda, see here:

if (TARGET cuda_target)
function(add_cuda_example example)
configure_file(
${CMAKE_CURRENT_SOURCE_DIR}/${example}.cpp
${CMAKE_CURRENT_BINARY_DIR}/${example}.cu
COPYONLY
)
cuda_add_executable(${example}_cuda ${CMAKE_CURRENT_BINARY_DIR}/${example}.cu
OPTIONS -DSOLVER_BACKEND_CUDA)
target_link_libraries(${example}_cuda amgcl_example cuda_target)
endfunction()
add_cuda_example(solver)
add_cuda_example(schur_pressure_correction)
add_cuda_example(cpr_drs)
endif()

@johnxcutor
Copy link
Author

johnxcutor commented Mar 25, 2018

I put it all in CUDA environment. But also got some error as below:

1>D:\dev\boost_1_64_0\boost/numeric/ublas/storage.hpp(299): error : namespace "boost::serialization" has no member "make_array"

Full output from compiler as below. kernel.cu is generated by CUDA wizard and was replaced by solver.cpp.

1>------ Build started: Project: gosolve_gpu, Configuration: Release x64 ------
1>  Compiling CUDA source file kernel.cu...
1>
1>  D:\dev\cpp\test_code\gosolve_gpu>"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env --cl-version 2015 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include"     --keep-dir x64\Release -maxrregcount=0  --machine 64 --compile -cudart static     -DSOLVER_BACKEND_CUDA -DWIN32 -DWIN64 -DNDEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /FS /Zi  /MD " -o x64\Release\kernel.cu.obj "D:\dev\cpp\test_code\gosolve_gpu\kernel.cu"
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(838): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(1772): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(2628): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(3477): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(4417): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(5319): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(6229): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(7104): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(7914): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt/device_functions.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt/device_functions.h(776): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt/device_functions.h(1636): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\device_double_functions.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\sm_20_intrinsics.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\sm_20_intrinsics.h(925): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>D:\dev\boost_1_64_0\boost/config/compiler/nvcc.hpp(9): warning C4005: '__CUDACC_VER__': macro redefinition
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(47): warning : "char (&operator||(const boost::mpl::s_item<T, Base> &, boost::mpl::aux::type_wrapper<T> *))[boost::mpl::next<Base::order>::type::value]" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(48): warning : "boost::mpl::aux::no_tag operator%(const boost::mpl::s_item<T, Base> &, boost::mpl::aux::type_wrapper<T> *)" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(63): warning : "boost::mpl::aux::yes_tag operator%(const boost::mpl::s_mask<T, Base> &, boost::mpl::aux::type_wrapper<T> *)" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(77): warning : "boost::mpl::aux::no_tag operator%(const boost::mpl::s_unmask<T, Base> &, boost::mpl::aux::type_wrapper<T> *)" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/typeof/msvc/typeof_impl.hpp(237): warning : extra ";" ignored
1>D:\dev\boost_1_64_0\boost/numeric/ublas/vector.hpp(640): warning : invalid friend declaration
1>D:\dev\boost_1_64_0\boost/numeric/ublas/vector.hpp(1418): warning : invalid friend declaration
1>D:\dev\boost_1_64_0\boost/numeric/ublas/vector.hpp(2780): warning : invalid friend declaration
1>D:\dev\boost_1_64_0\boost/property_tree/detail/ptree_utils.hpp(76): warning : pointless comparison of unsigned integer with zero
1>D:\dev\boost_1_64_0\boost/core/swap.hpp(36): warning : calling a __host__ function from a __host__ __device__ function is not allowed
1>D:\dev\boost_1_64_0\boost/core/swap.hpp(36): warning : calling a __host__ function("terminate") from a __host__ __device__ function("boost_swap_impl::swap_impl<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> ") is not allowed
1>D:\dev\boost_1_64_0\boost/core/swap.hpp(36): warning : calling a __host__ function("std::basic_string<char, std::char_traits<char>, std::allocator<char> >::_Swap_bx") from a __host__ __device__ function("boost_swap_impl::swap_impl<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> ") is not allowed
1>D:\dev\boost_1_64_0\boost/core/swap.hpp(36): warning : calling a __host__ function("std::swap<unsigned long long, void> ") from a __host__ __device__ function("boost_swap_impl::swap_impl<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> ") is not allowed
1>D:\dev\boost_1_64_0\boost/core/swap.hpp(36): warning : calling a __host__ function("std::swap<unsigned long long, void> ") from a __host__ __device__ function("boost_swap_impl::swap_impl<std::basic_string<char, std::char_traits<char>, std::allocator<char> >> ") is not allowed
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(838): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(1772): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(2628): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(3477): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(4417): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(5319): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(6229): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(7104): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\math_functions.h(7914): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt/device_functions.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt/device_functions.h(776): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt/device_functions.h(1636): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\crt\device_double_functions.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\sm_20_intrinsics.h : warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>c:\program files\nvidia gpu computing toolkit\cuda\v9.1\include\sm_20_intrinsics.h(925): warning C4819: The file contains a character that cannot be represented in the current code page (936). Save the file in Unicode format to prevent data loss
1>D:\dev\boost_1_64_0\boost/config/compiler/nvcc.hpp(9): warning C4005: '__CUDACC_VER__': macro redefinition
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(47): warning : "char (&operator||(const boost::mpl::s_item<T, Base> &, boost::mpl::aux::type_wrapper<T> *))[boost::mpl::next<Base::order>::type::value]" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(48): warning : "boost::mpl::aux::no_tag operator%(const boost::mpl::s_item<T, Base> &, boost::mpl::aux::type_wrapper<T> *)" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(63): warning : "boost::mpl::aux::yes_tag operator%(const boost::mpl::s_mask<T, Base> &, boost::mpl::aux::type_wrapper<T> *)" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/mpl/set/aux_/item.hpp(77): warning : "boost::mpl::aux::no_tag operator%(const boost::mpl::s_unmask<T, Base> &, boost::mpl::aux::type_wrapper<T> *)" declares a non-template function -- add <> to refer to a template instance
1>D:\dev\boost_1_64_0\boost/typeof/msvc/typeof_impl.hpp(237): warning : extra ";" ignored
1>D:\dev\boost_1_64_0\boost/numeric/ublas/storage.hpp(299): error : namespace "boost::serialization" has no member "make_array"
1>D:\dev\boost_1_64_0\boost/numeric/ublas/storage.hpp(494): error : namespace "boost::serialization" has no member "make_array"
1>D:\dev\boost_1_64_0\boost/numeric/ublas/vector.hpp(640): warning : invalid friend declaration
1>D:\dev\boost_1_64_0\boost/numeric/ublas/vector.hpp(1418): warning : invalid friend declaration
1>D:\dev\boost_1_64_0\boost/numeric/ublas/vector.hpp(2780): warning : invalid friend declaration
1>D:\dev\boost_1_64_0\boost/numeric/ublas/matrix.hpp(5978): error : namespace "boost::serialization" has no member "make_array"
1>  kernel.cu
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\BuildCustomizations\CUDA 9.1.targets(707,9): error MSB3721: The command ""C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\bin\nvcc.exe" -gencode=arch=compute_30,code=\"sm_30,compute_30\" --use-local-env --cl-version 2015 -ccbin "C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\x86_amd64" -x cu  -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include" -I"C:\Program Files\NVIDIA GPU Computing Toolkit\CUDA\v9.1\include"     --keep-dir x64\Release -maxrregcount=0  --machine 64 --compile -cudart static     -DSOLVER_BACKEND_CUDA -DWIN32 -DWIN64 -DNDEBUG -D_CONSOLE -D_MBCS -Xcompiler "/EHsc /W3 /nologo /O2 /FS /Zi  /MD " -o x64\Release\kernel.cu.obj "D:\dev\cpp\test_code\gosolve_gpu\kernel.cu"" exited with code 2.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

@ddemidov
Copy link
Owner

The error looks like a bug in Boost.uBlas 1.64:
boostorg/ublas#47

There is a workaround here:
https://stackoverflow.com/questions/44534516/error-make-array-is-not-a-member-of-boostserialization

Can you try that?

@johnxcutor
Copy link
Author

Yes, I also got this work around but It led to another issue. I'm working on this. Will update this later.

@ddemidov ddemidov closed this as completed Dec 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants