I'm getting the following error when trying to compile any BLAS2 or BLAS3 code. This includes my project or any of the examples. I'm running Windows 8 64-bit and I'm compiling ViennaCL with VS2012. Any ideas?
error C2893: Failed to specialize function template 'viennacl::enable_if<viennacl::is_any_dense_nonstructured_matrix<T>::value&&viennacl::is_any_dense_nonstructured_matrix<M2>::value&&viennacl::is_any_dense_nonstructured_matrix<T3>::value>::type viennacl::linalg::prod_impl(const MatrixType &,const VectorType1 &,VectorType2 &)'
1> With the following template arguments:
1> 'viennacl::matrix<SCALARTYPE>'
1> with
1> [
1> SCALARTYPE=float
1> ]
1> 'viennacl::vector<SCALARTYPE>'
1> with
1> [
1> SCALARTYPE=float
1> ]
1> 'viennacl::vector<SCALARTYPE>'
1> with
1> [
1> SCALARTYPE=float
1> ]
1> connection\connection.cpp(11) : see reference to function template instantiation 'viennacl::vector<SCALARTYPE> &viennacl::vector<SCALARTYPE>::operator =<viennacl::matrix<SCALARTYPE>,viennacl::vector<SCALARTYPE>>(const viennacl::vector_expression<LHS,RHS,OP> &)' being compiled
1> with
1> [
1> SCALARTYPE=float,
1> LHS=const viennacl::matrix<float>,
1> RHS=const viennacl::vector<float>,
1> OP=viennacl::op_prod
1> ]
1> connection\connection.cpp(11) : see reference to function template instantiation 'viennacl::vector<SCALARTYPE> &viennacl::vector<SCALARTYPE>::operator =<viennacl::matrix<SCALARTYPE>,viennacl::vector<SCALARTYPE>>(const viennacl::vector_expression<LHS,RHS,OP> &)' being compiled
1> with
1> [
1> SCALARTYPE=float,
1> LHS=const viennacl::matrix<float>,
1> RHS=const viennacl::vector<float>,
1> OP=viennacl::op_prod
1> ]
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
thanks for reporting. It seems like there is some glitch/change in VS 2012 that makes the compiler behave differently than their predecessors. VS 2005 and VS 2010 were tested explicitly, but it seems that this wasn't enough (our experience with different codes is that once it compiles on VS 2005, it works with all newer versions). I will obtain and test VS 2012 Express later today and let you know.
Best regards,
Karli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
alright, I've looked at VS 2012 and can only conclude that something is badly broken in VS 2012. More precisely, the compiler messes up the enable_if<> constructs. For example, in your snippet there are complaints about
Clearly, there are no T, M2 and T3 types in the list of function arguments which could be matched. However, there is no such function in ViennaCL with that signature.
and here all the types match. I've checked the various other examples and found that e.g. examples/tutorials/blas1.cpp fails due to a similar mix-up in VS 2012 when using vector_assign, and for inplace_solve in e.g. examples/tutorials/blas2.cpp
In summary, my only conclusion is that this is a bug in VS 2012 which we cannot reasonably circumvent without larger refactoring of valid code. :-(
Best regards,
Karli
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
I'm getting the following error when trying to compile any BLAS2 or BLAS3 code. This includes my project or any of the examples. I'm running Windows 8 64-bit and I'm compiling ViennaCL with VS2012. Any ideas?
Hi,
thanks for reporting. It seems like there is some glitch/change in VS 2012 that makes the compiler behave differently than their predecessors. VS 2005 and VS 2010 were tested explicitly, but it seems that this wasn't enough (our experience with different codes is that once it compiles on VS 2005, it works with all newer versions). I will obtain and test VS 2012 Express later today and let you know.
Best regards,
Karli
Hi again,
alright, I've looked at VS 2012 and can only conclude that something is badly broken in VS 2012. More precisely, the compiler messes up the enable_if<> constructs. For example, in your snippet there are complaints about
Clearly, there are no T, M2 and T3 types in the list of function arguments which could be matched. However, there is no such function in ViennaCL with that signature.
The respective function in ViennaCL is
and here all the types match. I've checked the various other examples and found that e.g. examples/tutorials/blas1.cpp fails due to a similar mix-up in VS 2012 when using vector_assign, and for inplace_solve in e.g. examples/tutorials/blas2.cpp
In summary, my only conclusion is that this is a bug in VS 2012 which we cannot reasonably circumvent without larger refactoring of valid code. :-(
Best regards,
Karli
Thanks for the super fast reply. I can confirm that switching to the VS2010 toolset fixes the problem.
Hi,
you're welcome. :-) I filed a bug report at Microsoft, let's see whether this changes anything.
Thanks again and best regards,
Karli
FYI: The latest 1.4.2-release now compiles cleanly on VS 2012. We restructured the code significantly so that the bug in VS 2012 does not show up.