kernel launch failure

Hi All,

I am a CUDA newbie.

while making a call to my kernel function from the main.cu file ,i get the below error :

mainfactor.cu(289): error: expression must have integral or enum type

The error is repeated twice when i try to make the project.

Can Any one advice what i am missing/doing wrong here?

P S : Here is a snippet of the kernel call

while ((p<MaxP+1)&&(pass==0))
{
// calling kernel to be executed on Device
main_kernel<<480,128>>(
all req parameters);
CUT_CHECK_ERROR(“mainfactoronGPU() execution failed\n”);
CUDA_SAFE_CALL( cudaThreadSynchronize() );

some multiple if and for conditions

}

Thanks Much in Advance.

Cheers,
-Sudy

That is a compilation error, not a runtime error. Where is line 289 in your code? (I am guessing it is the call to the kernel you didn’t include using the arguments you didn’t show).

“mainfactor.cu(289): error: expression must have integral or enum type” suggest that nvcc expect integral type, One case of this will be when u declared an array in kernel whose dimension is not known at compile time.

Thanks , seems I had a couple of device inline undeclared in my main file and also jumbled up the kernel arguments called from host and the one’s referred in the actual _kernel file…will rectify…

Out of Curiosity : can i refer a constant value for an array as a parameter in my host call to kernel function.

something like

main_kernel<<480,128>>(0.0,arr2);

global void main_kernel(double *arr1,double arr2 *);

regards,

<<< MyKernelName >>>

not

<>

:shifty: