I have a query in the below given code, i want to make
it generic,inline function (poly(d_x[i],d_func,N)) which is kernel.
Can i call any other inline function having same argument
without changing the function name in kernel.
global void Matrix_generation(float *d_x,float *d_y,float *d_b,float *d_svU,float *d_sig,float *d_func,int M,int N)
{
float tmp=0.0;
int i=blockIdx.x*blockDim.x+threadIdx.x;
if(i<M)
{
poly(d_x[i],d_func,N);
if(d_sig[i]==0.0)
tmp=1.0;
else
tmp=1.0/d_sig[i];
for(int j=0;j<N;j++){
d_svU[i*N+j]=d_func[j]*tmp;}
d_b[i]=d_y[i]*tmp;
}__syncthreads();
}
device void poly(float d_x,float *d_func,int N)
{
int j;
d_func[0]=1.0;
for(j=1;j<N;j++)
{
d_func[j]=d_func[j-1]*d_x;
}
}