float2 problem in thrust compiling with -G

Using the following program:

#include “thrust/host_vector.h”
int main()
{
thrust::host_vector< float2 > h_data( 512 );
return 0;
}

produces the following compiler warnings/errors:

nvcc -g -G -arch sm_20 -c testfloat.cu -o testfloat
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h: In function `ZN6thrust6detail26uninitialized_fill_functorI6float2Ecl
ERS2
’:
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h:478: warning: cast to pointer from integer of different size
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h(478): Error: External calls are not supported (found non-inlined call to _ZnwmPv)

nvcc -g -G -c testfloat.cu -o testfloat
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h: In function `ZN6thrust6detail26uninitialized_fill_functorI6float2Ecl
ERS2
’:
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h:478: warning: cast to pointer from integer of different size

nvcc -c testfloat.cu -o testfloat
// produces no warnings or errors

This seems like a compiler bug to me.

nvcc --version
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2010 NVIDIA Corporation
Built on Wed_Sep__8_17:12:45_PDT_2010
Cuda compilation tools, release 3.2, V0.2.1221

thrust version: 1.3

gcc (GCC) 4.1.2 20070115 (prerelease) (SUSE Linux)

CPU: x86_64
GPU: Fermi

Using the following program:

#include “thrust/host_vector.h”
int main()
{
thrust::host_vector< float2 > h_data( 512 );
return 0;
}

produces the following compiler warnings/errors:

nvcc -g -G -arch sm_20 -c testfloat.cu -o testfloat
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h: In function `ZN6thrust6detail26uninitialized_fill_functorI6float2Ecl
ERS2
’:
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h:478: warning: cast to pointer from integer of different size
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h(478): Error: External calls are not supported (found non-inlined call to _ZnwmPv)

nvcc -g -G -c testfloat.cu -o testfloat
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h: In function `ZN6thrust6detail26uninitialized_fill_functorI6float2Ecl
ERS2
’:
/usr/local/cuda/bin/…/include/thrust/detail/internal_functional.h:478: warning: cast to pointer from integer of different size

nvcc -c testfloat.cu -o testfloat
// produces no warnings or errors

This seems like a compiler bug to me.

nvcc --version
nvcc: NVIDIA ® Cuda compiler driver
Copyright © 2005-2010 NVIDIA Corporation
Built on Wed_Sep__8_17:12:45_PDT_2010
Cuda compilation tools, release 3.2, V0.2.1221

thrust version: 1.3

gcc (GCC) 4.1.2 20070115 (prerelease) (SUSE Linux)

CPU: x86_64
GPU: Fermi

Your version of gcc is too old. You need at least 4.2, I think. 4.3 would be even better.

Your version of gcc is too old. You need at least 4.2, I think. 4.3 would be even better.

I will give that a try. Unfortunately, for me, the project I am using this for does not support the newer compilers. I will verify this works and start the campaign to move to a newer compiler. Thanks.

I will give that a try. Unfortunately, for me, the project I am using this for does not support the newer compilers. I will verify this works and start the campaign to move to a newer compiler. Thanks.