Error passing parameters to kernel

Hi all,

When I try to compile some code that passes a parameter to a kernel, I get error: expected a “)” from NVCC. For example, if I define a kernel as:

global void test1() {

}

and try to compile, everything goes fine. But if I define a kernel as:

global void test12(int x) {

}

I get the error. Any ideas?

Thanks.

There is nothing wrong with either of those declarations. The error lies somewhere else.

Thats what I thought. Well then here are the two files of my code:

ParticleFilter.cu: http://pastebin.com/bKHkE2X8

normal.cuh: http://pastebin.com/9H1LpHTp

Compiled with nvcc ParticleFilter.cu -lcurand -o particle, with output:

ParticleFilter.cu(26): error: expected a ")"

ParticleFilter.cu(40): error: identifier "randu" is undefined

ParticleFilter.cu(61): error: identifier "indices" is undefined

ParticleFilter.cu(167): error: identifier "resampletest" is undefined

ParticleFilter.cu(168): error: too many arguments in function call

ParticleFilter.cu(114): warning: variable "p" was set but never used

5 errors detected in the compilation of "/tmp/tmpxft_000008ff_00000000-4_ParticleFilter.cpp1.ii".

Any help is greatly appreciated. Thanks.

There is an elementary programming error concerning a preprocessor symbol in your ParticleFilter.cu file.

I’m a bit confused, where at?

N

Ahhh tricky. Thank you very much.