Error in Kernel Code

Discussion created by dabrunhosa on May 12, 2009
Latest reply on May 14, 2009 by gaurav.garg
Beginner Errors

Hi, I'm a beginner to the Brook+ development and I can't understand what is wrong with the code that follows:

kernel void calcular_integral(float input<>,float xo_g,float xf_g,float h,float num_processos,out float output<>
    float tam;
    float xo_l;
    float xf_l;
    float soma;
    float nx;
    float x;
    float i;
    tam = ((xf_g - xo_g)/num_processos);
    xo_l = tam * input;
    xf_l = (tam * input)+ tam;
    nx = (xf_l - xo_l) / h;
    soma = (xo_l * xo_l) + (xf_l * xf_l);
    i = 1.0f;
    for(; i < nx; i++)
        x = (xo_l + (h * i));
        soma += 2.0f *(x*x);
    output = soma * (h/2.0f);


Please Help me. If you need more information than the code above, please tell me. The rest of my code executes perfectly, but when begins to execute the kernel code the following error occur :

Stream Write : Stream can't write to a NULL pointer.

I appreciate any help you can give me.