Hi!!
I would like to know how to call a normal C function within another function in a kernel.
this is de code!!

float sinc(float x)
{
if(x==0.0f)
{
return 1.0f;
}
else
{
return sin(3.14159265358979323846f*x)/(3.14159265358979323846f*x);
}
}

float* filter_design_direct_I(int M, float Beta, float wc1, float wc2, float* h,float* y, float* wn, float* hn,float* izero_var, float izero_beta)
{
int i;

for (i=0; i<=M; i++){
h[i]=(wc1/3.14159265358979323846f)*sinc(wc1/3.14159265358979323846f*(i-(M/2)))-((wc2/3.14159265358979323846f)*sinc(wc2/3.14159265358979323846f*(i-(M/2))));
}
.
.
.
}


I put this but it gives me error: CL_BUILD_PROGRAM_FAILURE
__kernel void filter_final(float wc1_lpf_s, float wc2_bpf_s, float wc1_bpf_s, __global float *salida_bpf_s_rectif,__global float *salida_bpf_s, __global float * hn_lpf_s,__global float *hn_bpf_s, __global float* entrada, int length, int M_bpf, int M_lpf ,float Beta_bpf, float Beta_lpf, __global float *salida_lpf_X, float delta_w_bpf, float fm, float f0)
{
wc1_bpf_s = (f0*2*3.14159265358979323846f/fm)+delta_w_bpf;
wc2_bpf_s = (f0*2*3.14159265358979323846f/fm)-delta_w_bpf;
hn_bpf_s = filter_design_direct_I(M_bpf, Beta_bpf, wc1_bpf_s, wc2_bpf_s);
.
.
.
}

please!! Help me!!!