[font=“Arial”]As mentioned in the topic, I am getting a compile-time error by nvcc on the scanLargeArray project of the NVIDIA SDK 2.3
which I have been unable to track down. I am using the NVIDIA Toolkit 2.3 on Fedora 11, properly setup to use gcc34/g++34
wherever necessary . scanLargeArray is the only project which fails to build, and the error doesn’t help me to find the fault :
CUDA_DEPS and #include in the Makefile and *.cu files of the project appear to be in proper order. I should also note that
this irrespective of 32/64bit architectures, as I tried in both platforms (Fedora11, properly configured).
I believe the error lies in the way the templated function “precan” ( template <bool storeSum, bool isNP2>global void prescan )
in the scanLargeArray_kernel.cu file is handled by the compiler. I hope the compiler errors below will be familiar to someone
who will help me find the bug/misconfiguration :
[codebox]
/CUDA_INSTALL_PATH/bin/nvcc --compiler-bindir \
GCC34_COMPAT_DIR --compiler-options -fno-strict-aliasing \
-I. -I/CUDA_INSTALL_PATH/include -I…/…/common/inc -DUNIX \
-O2 -o obj/release/scanLargeArray.cu.o -c scanLargeArray.cu
./scan.cu: In function `void prescanArrayRecursive(float*, const float*, int, int)':
./scan.cu:168: error: `prescan__entry’ was not declared in this scope
./scan.cu:168: error: expected primary-expression before ‘)’ token
./scan.cu:175: error: expected primary-expression before ‘)’ token
./scan.cu:208: error: `prescan__entry’ was not declared in this scope
./scan.cu:208: error: expected primary-expression before ‘)’ token
./scan.cu:214: error: `prescan__entry’ was not declared in this scope
./scan.cu:214: error: expected primary-expression before ‘)’ token
In file included from scanLargeArray.cu:160:
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: \
In function `void __device_stub__Z7prescanILb1ELb0EEvPfPKfS0_iii(float*, const float*, float*, int, int, int)':
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:41: error: `prescan__entry’ was not declared in this scope
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:41: error: expected primary-expression before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:41: error: expected `)’ before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:41: error: expected `)’ before ‘;’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:41: error: expected primary-expression before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:41: error: expected `)’ before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: At global scope:
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:44: error: expected initializer before ‘<’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: \
In function `void __device_stub__Z7prescanILb1ELb1EEvPfPKfS0_iii(float*, const float*, float*, int, int, int)':
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:49: error: `prescan__entry’ was not declared in this scope
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:49: error: expected primary-expression before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:49: error: expected `)’ before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:49: error: expected `)’ before ‘;’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:49: error: expected primary-expression before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:49: error: expected `)’ before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: At global scope:
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:52: error: expected initializer before ‘<’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: \
In function `void __device_stub__Z7prescanILb0ELb0EEvPfPKfS0_iii(float*, const float*, float*, int, int, int)':
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:57: error: `prescan__entry’ was not declared in this scope
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:57: error: expected primary-expression before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:57: error: expected `)’ before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:57: error: expected `)’ before ‘;’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:57: error: expected primary-expression before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:57: error: expected `)’ before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: At global scope:
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:60: error: expected initializer before ‘<’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: \
In function `void __device_stub__Z7prescanILb0ELb1EEvPfPKfS0_iii(float*, const float*, float*, int, int, int)':
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:65: error: `prescan__entry’ was not declared in this scope
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:65: error: expected primary-expression before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:65: error: expected `)’ before “char”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:65: error: expected `)’ before ‘;’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:65: error: expected primary-expression before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:65: error: expected `)’ before “void”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: At global scope:
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:68: error: expected initializer before ‘<’ token
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c: \
In function `void __sti____cudaRegisterAll_49_tmpxft_00001cfb_00000000_4_scanL
argeArray_cpp1_ii_839760fd()':
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: `prescan__entry’ was not declared in this scope
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected primary-expression before “const”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected `)’ before “const”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected primary-expression before “const”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected `)’ before “const”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected primary-expression before “const”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected `)’ before “const”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected primary-expression before “const”
/tmp/tmpxft_00001cfb_00000000-1_scanLargeArray.cudafe1.stub.c:117: error: expected `)’ before “const”
make: *** [obj/release/scanLargeArray.cu.o] Error 255[/codebox]
Further questions :
Are nvcc templates full-blown C++ templates ?
What kind of types can I have as template T types - C primitives, right ?
Where can I find more information about nvcc templates (something more solid than looking at the SDK) ?[/font]
[font=“Arial Narrow”]PS> This is my first post, so I should not be rude: hi everyone![/font]