Help with complier problem

Hi guys,
I have this problem and I know it is because I follow the C99 feature…
tmpxft_00000da3_00000000-8.i:(.text+0x161f5): undefined reference to __vla_alloc' tmpxft_00000da3_00000000-8.i:(.text+0x197d6): undefined reference to __vla_dealloc’

But my code is kind of long and how can I find the right position for this problem in the code ?

Thanks External Image

I think these errors come up if you dynamically allocate memory like this:

int function(int N)

    {

    float array[N];

    ....

    }

Yes, I know that. But how can I find the place if my code is long?

You could use grep to narrow down your search.

grep -n "float\([[:space:]]\)\{1,\}\([[:alnum:]]\)\{1,\}\[\([[:alpha:]]\)\{1,\}" input.c

Hello!

the name of the topic suits me more than well. I am new to CUDA programing and I have written some code which doesn’t want to compile. External Image
The problem I have is that in the main file (extension .cu) when I call the kernel function, the compiler doesn’t recognize that it is from another file ( (name)_kernel.cu). He gives me several errors:

error: identifier “(function name)” is undefined
warning: expression has no effect
warning: expression has no effect
warning: expression has no effect
warning: expression has no effect
warning: expression has no effect
warning: expression has no effect
error: no operator “>>” matches these operands
operand types are: dim3 >> int *

I included the (nema)_kernel.cu file and I don’t know why he shows me those messgaes.

Every kind of help is more then welcome.

Are you using two signs (>>) or three (>>>)?

Did you make sure you included the file containing the kernel into your file. Othewise this notation will, AFAIK, not work.

@ETFbl,

Create a C wrapper function that will just plain call the GPU kernel and export it as an extern C function and call it from any other file you want.

i am using two sings ( kernelFunctionName<<gridSize,blockSize>> (parameters) ). the gridSize and blockSize are defined as dim3 parameters.

I did make sure I included the file into my mainFile.cu . That’s what makes me wonder why these errors occur.

I got the part with the wrapper function, but I don’t know how to do the rest. Can you tell me how to do that, or tell about a source where I can look it up?

thanx

Just use 3…

thanx. I just realized this morning what a stupid mistake that was and that I didn’t see it before.