Problem Compiling

174 views
Skip to first unread message

boerboon

unread,
Oct 25, 2009, 2:19:34 PM10/25/09
to CuPP
Hello,

I am having a problem compiling CuPP 1.3. CMake runs fine but when I
get to compiling using make I get this error:


[ 11%] Built target cupp
[ 22%] Building (Device) NVCC /home/james/UniWork/cupp/examples/
memory1d/kernel_memory1d.cu: /home/james/UniWork/cupp/examples/
memory1d/./kernel_memory1d_generated_kernel_memory1d.cu.o
/home/james/UniWork/cupp/examples/memory1d/kernel_memory1d.cu(10):
error: a __global__ routine cannot have reference arguments

1 error detected in the compilation of "/tmp/
tmpxft_0000202b_00000000-4_kernel_memory1d.cpp1.ii".
CMake Error at kernel_memory1d_generated_kernel_memory1d.cu.o.cmake:
205 (message):
Error generating file
/home/james/UniWork/cupp/examples/memory1d/./
kernel_memory1d_generated_kernel_memory1d.cu.o


make[2]: *** [examples/memory1d/./
kernel_memory1d_generated_kernel_memory1d.cu.o] Error 1
make[1]: *** [examples/memory1d/CMakeFiles/kernel_memory1d.dir/all]
Error 2
make: *** [all] Error 2


Looking at kernel_memory1d.cu(10) I see

__global__ void global_function (cupp::deviceT::memory1d<int>& p)

Maybe I am been a little dim here but is not passing by reference is C+
+ only? I thought nvcc reads the code as C.

I am running Ubuntu 9.04 with NVIDIA Driver Version: 185.18.14

The sdk and toolkit is 2.3


Did I miss something in compiling?

Regards

James


Jens Breitbart

unread,
Oct 27, 2009, 12:17:26 PM10/27/09
to CuPP
Hi,

sorry for the late reply. I am afraid you are correct. At the current
time CuPP cannot be compiled with the latest CUDA version.

Depending on what functionality you are looking for, thrust may be an
alternative to use: http://code.google.com/p/thrust/

-Jens

Fred

unread,
Dec 13, 2009, 2:51:01 PM12/13/09
to CuPP
Has anyone found a fix for the compile error mentioned in this thread
for Windows?

Lines like this won't compile with the latest CUDA:
__global__ void global_function (cupp::deviceT::vector<int> &i) {

changing it to something like this means changing something in cupp or
perhaps boost:
__global__ void global_function (cupp::deviceT::vector<int>* i) {

Is there a way of tricking NVCC into accepting it?
> > James- Hide quoted text -
>
> - Show quoted text -

Jens Breitbart

unread,
Dec 14, 2009, 11:51:12 AM12/14/09
to CuPP
Not that I am aware of. Would the second code option (with the pointer
instead of a reference) help you? I guess the changes required to CuPP
for this to work would be rather small.

-Jens

Fred

unread,
Dec 15, 2009, 2:13:51 PM12/15/09
to CuPP
This is the only problem I know about. I'd be willing to try out your
fix on Windows if you publish a new version. I would have thought
that the same problem would happen with other platforms too, because
it is the nvcc compiler complaining that references aren't allowed.
> > > - Show quoted text -- Hide quoted text -

Fred

unread,
Dec 15, 2009, 2:14:25 PM12/15/09
to CuPP
Yes the second option with the pointer would be the way to go.
> > > - Show quoted text -- Hide quoted text -

Jens Breitbart

unread,
Dec 16, 2009, 8:26:27 AM12/16/09
to CuPP
Thanks, I'll have a look and let you know. The references were working
for some time, as they automatically got transformed into
automatically derefered pointers, so CuPP just passes a pointer for
all reference parameters.

-Jens

Jens Breitbart

unread,
Dec 21, 2009, 10:26:53 AM12/21/09
to CuPP
Hi,

there is a test version available at

http://groups.google.com/group/cupp/web/cupp_v0.1.4_rc.tar.gz

This version requires using CUDA 3.0 beta, compiling it with CUDA 2.3
should result in an internal nvcc compiler error. I'd be happy if you
could tell me, if it compiles fine in Windows.

Best,
Jens

On Dec 15, 8:13 pm, Fred <baker.kevin.ja...@gmail.com> wrote:

Reply all
Reply to author
Forward
0 new messages