dabrunhosa

Problems with Kernel Code

Discussion created by dabrunhosa on Jun 2, 2009
Latest reply on Jun 9, 2009 by dabrunhosa

Hi, I'm having some problems when compiling the code above.

kernel void calcular_eq_calor(double input[],double dt,double dx,double t_final,double x_final,double alpha,int nx,int num_processos,out double output<>
{
    double i , m;
    double x , t , beta;

    t = 0.0;
    m = 0.0;
    beta = (alpha*dx*dx)/dt;

   while (t <= t_final)
   {
      // ======================== BEGIN ========================
      i = 1.0;
      x = (double) i*dx;
      while (x < x_final)
      {
         // ============== BEGIN =============
          output = (input[i+1.0] - (2.0 - beta)* input + input[i-1.0])/beta;         
          // =============== END ===============
          i++;
          x = (double) i*dx;
      }
      // ========================= END =========================
      m++;
      t = (double) m*dt;
   }
}

I want to be able to access the input [i+1], input[i-1] e o input, and put this data in the output. How can i do this ?

 

Outcomes