4 Replies Latest reply on Nov 5, 2010 8:49 AM by spectral

    Access violation : new memory bug ?

    spectral

      I have a strange behaviour in my OpenCL kernel. I have the following code :

       

      void Texture_Get(__global RGB* pixels, const unsigned int width, const unsigned int height, const int s, const int t, Spectrum* spectrum)

      {

      Spectrum p;

      p.x = ((__global Spectrum*)pixels)->x;

      p.y = ((__global Spectrum*)pixels)->y;

      p.z = ((__global Spectrum*)pixels)->z;

      printf(\"%f %f %f \", p.x, p.y, p.z);return;

      }

       

      __global RGB* pixels = (__global RGB*)&(scene->pixmapsBuffer[map->offset]);

       

      Spectrum p;

      p.x = ((__global Spectrum*)pixels)->x;

      p.y = ((__global Spectrum*)pixels)->y;

      p.z = ((__global Spectrum*)pixels)->z;

      printf(\"%f %f %f \", p.x, p.y, p.z);return;

      Texture_Get(pixels, width, height, s0, t0, &c0);



      When I remove the code in the method Texture_Get... I have no crash ! But the code is exactly the same than before calling the method !!!