I’m trying to compile my project on windows xp 32 bit using MSVC 2010 and CUDA Fortran 11.10:
MSVC 2010 Console:
nvcc -m32 -c -arch sm_13 csort.cu --cl-version 2008 -o a.obj
PGI Workstation:
$ pgf90 -m32 coursework_2011_cuda_tesla_1dv2.cuf a.obj
coursework_2011_cuda_tesla_1dv2.cuf:
./coursework_2011_cuda_tesla_1dv2.exf: warning: unknown section ".nv_fatb" found, executable not
stripped. Use the linker's /merge option to merge this section
with another. Example: "/merge:.nv_fatb=.data"
Where csort.cu:
#include <thrust/device_vector.h>
#include <thrust/device_vector.h>
#include <thrust/sort.h>
extern "C" {
//Sort for integer arrays
void sort_int_wrapper( int *data, int N)
{
// Wrap raw pointer with a device_ptr
thrust::device_ptr <int> dev_ptr(data);
// Use device_ptr in Thrust sort algorithm
thrust::sort(dev_ptr, dev_ptr+N);
}
//Sort for float arrays
void sort_float_wrapper( float *data, int N)
{
thrust::device_ptr <float> dev_ptr(data);
thrust::sort(dev_ptr, dev_ptr+N);
}
//Sort for double arrays
void sort_double_wrapper( double *data, int N)
{
thrust::device_ptr <double> dev_ptr(data);
thrust::sort(dev_ptr, dev_ptr+N);
}
}
The problem in misunderstanding output by pgf90. I’ve tried -# switch to see exactly where error is forming: $ pgf90 -m32 coursework_2011_cuda_tesla_1dv2.cuf a.obj -# > send.txcoursework_ - Pastebin.com
I’m not sure what means this error, because this only happends on MSVC 2010 with pgi workstation 11.10 (I’ve compiled same thing on Windows 7 with MSVC 2008 and all seems okay).
For example, building on Linux with pgi workstation 11.9 gives no warnings.
I guess I need to pass /merge argument to MSVC linker, but didn’t find switch that enable this. Should I execute all above commands by myself and add switch manually?
P.S. tried also next code:
pgf90 -m32 coursework_2011_cuda_tesla_1dv2.cuf a.obj -# -Wl,/merge:.nv_ftab=.data
but it didn’t works.