Pass array by reference breaks cudafe invariant Problem report

Hi all,

When I try to pass a reference to an array to a kernel, cudafe(?) fails with an internal error.

The code below triggers this behaviour on my system:

template<unsigned int chunk_levels, unsigned int layers, class T>

__global__ void

foo( const unsigned int (&offsets)[layers] )



int main()


 Â unsigned int offsets[3];

 Â foo<3,3,unsigned int><<<dim3(42,1),dim3(64,1)>>>( offsets );

 Â return 0;


When I try to compile it:

[font=“Courier”]modesty ~ $ nvcc -V

nvcc: NVIDIA ® Cuda compiler driver

Copyright © 2005-2007 NVIDIA Corporation

Built on Tue_Jun_10_05:42:45_PDT_2008

Cuda compilation tools, release 1.1, V0.2.1221

modesty ~ $ nvcc internal error: assertion failed at: “/home/buildmeister/nightly/rel/gpgpu/toolkit/r2.0/compiler/edg/EDG_3.9/src/il_to_str.c”, line 4188

1 catastrophic error detected in the compilation of “/tmp/tmpxft_00002cbb_00000000-4_reproduce.cpp1.ii”.

Compilation aborted.

nvcc error : ‘cudafe’ died due to signal 6

modesty ~ $ [/font]

I run CUDA 2.0 beta2 on driver rel 177.13 on a gentoo linux with gcc 4.1.2.



Edit: I know that the code is insane. :)