viennacl / viennacl-dev

Developer repository for ViennaCL. Visit http://viennacl.sourceforge.net/ for the latest releases.
Other
282 stars 91 forks source link

CUDA error when compiling "lanczos.hpp" #139

Closed ramirezaa closed 9 years ago

ramirezaa commented 9 years ago

I am using the branch named "karlrupp/feature-improve-lanczos" and I try to compile my program with the nvcc compiler. At the top of my program I have the following include:

#include "viennacl/linalg/lanczos.hpp"

When I proceed to compile the program, I get the following compiling error:

/usr/include/boost/numeric/ublas/storage_sparse.hpp: In static member function ‘static void boost::numeric::ublas::map_array<I, T, ALLOC>::static_destroy(boost::numeric::ublas::map_array<I, T, ALLOC>::reference)’:
/usr/include/boost/numeric/ublas/storage_sparse.hpp:505:16: error: expected primary-expression before ‘,’ token
(&p) -> ~value_type ();
^
/usr/include/boost/numeric/ublas/storage_sparse.hpp:505:19: error: expected primary-expression before ‘>’ token
(&p) -> ~value_type ();
^
/usr/include/boost/numeric/ublas/storage_sparse.hpp:505:21: error: expected primary-expression before ‘)’ token
(&p) -> ~value_type ();

When I do not have the #include "viennacl/linalg/lanczos.hpp" then my program compiles just fine, which is undesirable since I need that particular include file. Should I be compiling a program with a GPU backend differently in order to incorporate this version of lanczos algorithm?

karlrupp commented 9 years ago

These errors are due to incompatible versions of CUDA and Boost. If you currently use CUDA 7, try to downgrade to CUDA 6.5 or CUDA 6.0. If you are not using the latest version of Boost, try to upgrade that. There's nothing we can do on the ViennaCL side to fix this (other than avoiding any use of uBLAS, which is actually work-in-progress).

ramirezaa commented 9 years ago

I tried to confirm your statement, but it might be untrue. First off, I am using:

In order to check your statement I included the ViennaCL 1.6.2 release in my program and compiled with NVCC. Again, I included lanczos.hpp while using the newest release and it compiled just fine and I did not get the aforementioned error. Then to compare I used karlrupp/feature-improve-lanczos and I got the aforementioned Boost error. Both versions of lanczos.hpp contain the same Boost headers which are:

Since both versions of lanczos algorithm use the same boost methods, and they also both have the same non-boost includes, I do not why I am getting the aforementioned error when I use the karlrupp/feature-improve-lanczos version.

karlrupp commented 9 years ago

Well, the instantiated functionality is not identical in the release and the feature branch, so the additional operations required in the feature branch trigger the issue.

I just had another look at the Lanczos implementation and I think it's not too hard to get rid of the use of uBLAS. This should fix the problems you described. The remaining parts of Boost are harder to eliminate, though. Let me see what I can do tomorrow...

ramirezaa commented 9 years ago

I now understand what you mean now. Thank you for the explanation. Additionally, if you could get rid of that particular issue, then I would be very appreciative. As long as that issue can be easily resolved, then I have no more concerns.

karlrupp commented 9 years ago

Any use of uBLAS from the Lanczos implementations is now removed: https://github.com/viennacl/viennacl-dev/commit/05b738c55cdf17a02a479666b3a0edbf5b0a455e CUDA compilation works fine on my machine. Please let us know whether this fixes the issue for you.

ramirezaa commented 9 years ago

The issues that I previously mentioned have been fixed for me. Thank you very much! You have been a huge help!