Can i send a call to kernel from my c code to do some normal mathematical operation without memory allocation.Means i want to just send a normal function call to kernel as we do in c/c++.

here is an example…

c code:

float xmax=100;

float xmin=200;

float ymax=300;

float ymin=400;

double dx,dy,dmax;

float xmid,ymid;

kernel_test<<<1,1>>>(a,b,c,d,e);

Cuda code

**global** void

kernel_add(double dx,double dy,double dmax,float xmid,float ymid,float xmax,float xmin,float ymax,float ymin)

{

dx = xmax - xmin;

dy = ymax - ymin;

dmax = (dx > dy) ? dx : dy;

xmid = (xmax + xmin) / 2.0;

ymid = (ymax + ymin) / 2.0;

}

But i m not getting the required result when i make this kernel call.Can anyone please help me with this?

Thanks in advance!!!