Hi all,
I have a weird bug with the CUDA compiler nvcc (v. 4.1, Linux) and Boost::uBLAS (1.48.0). I need to copy data out of uBLAS vectors/matrices into GPU space, hence I need to compile a file containing Boost::ublas structures as well as CUDA code -- hence compiling Boost::uBLAS with nvcc.
I am including ublas/operation.hpp, ublas/matrix.hpp, ublas/matrix_sparse.hpp, ublas/matrix_proxy.hpp, ublas/vector.hpp, and ublas/io.hpp.
The underlying version of GCC is 4.3.2 on a Suse Linux platform. If I comment out all the CUDA code and compile with raw g++, then everything is fine. However, if I compile with nvcc, then I get many errors like the following:
/home/stats/stsiab/include/boost/numeric/ublas/vector_sparse.hpp: In member function ‘const T* boost::numeric::ublas::mapped_vector
On Fri, Feb 10, 2012 at 02:57:54PM +0000, Chris Jewell wrote:
/home/stats/stsiab/include/boost/numeric/ublas/vector_sparse.hpp:390: error: ‘__T13’ has not been declared
What is "__T13"? grep on the Boost source doesn't find it, so I assume that I'm missing a header from somewhere else? The other odd thing is that there is no reference to my CUDA file. Furthermore, everything works well on my MacBook Pro with GCC 4.2.1 and nvcc 4.1.
When you get mysterious token errors appearing in source code, the culprit is almost always a rogue macro defined by the compiler or by some header earlier in the build process. Look at the untainted source line, see what originally is there and look for what could make it expand in a way you don't expect it to. Single-letter macros tend to be more common than you think, it could be as simple as a #define M __T13 sneaking in from the toolchain you use. -- Lars Viklund | zao@acc.umu.se
On 11 Feb 2012, at 00:26, Lars Viklund wrote:
On Fri, Feb 10, 2012 at 02:57:54PM +0000, Chris Jewell wrote:
/home/stats/stsiab/include/boost/numeric/ublas/vector_sparse.hpp:390: error: ‘__T13’ has not been declared
What is "__T13"? grep on the Boost source doesn't find it, so I assume that I'm missing a header from somewhere else? The other odd thing is that there is no reference to my CUDA file. Furthermore, everything works well on my MacBook Pro with GCC 4.2.1 and nvcc 4.1.
When you get mysterious token errors appearing in source code, the culprit is almost always a rogue macro defined by the compiler or by some header earlier in the build process.
Look at the untainted source line, see what originally is there and look for what could make it expand in a way you don't expect it to.
Single-letter macros tend to be more common than you think, it could be as simple as a #define M __T13 sneaking in from the toolchain you use.
So this looks like an inability (bug?) of nvcc to compile the sparse vector (and matrix) template classes. I can reproduce the bug with a piece of code as simple as
#include
participants (2)
-
Chris Jewell
-
Lars Viklund