1 Reply Latest reply on Jan 25, 2017 1:46 AM by dipak

    opencl compiler error (segmentation fault)

    jpsollie

      Is it possible that passing a constant string as an argument is not supported by the OpenCL compiler?

      this OpenCL code gives me a segmentation fault with BuildKernel():

      [quote]

      void Updatec(MEMBLK *context, __constant const uchar *dataptr, const uchar len);

      function xxx(MEMBLK* context) {   

      uchar i;   

      uchar finalcount[8];   

      Updatec(context, "\200", 1);   

      while ((context->count & 504) != 448) {

              Updatec(context, "\0", 1);

              context->count = 448;     }

      }

      [/quote]

      while the following runs fine:

      [quote]

      constant uchar static_characters[] = { 128, 0 };

      void Updatec(MEMBLK *context, __constant const uchar *dataptr, const uchar len);

      function xxx(MEMBLK* context) {

           uchar i;   

          Updatec(context, static_characters, 1);

           while ((context->count & 504) != 448) {

               Updatec(context, &static_characters[1], 1);

               context->count = 448;

           }

      }

      [/quote]

      any ideas what is happening? thank you!

       

      Message was edited by: janpieter sollie *edit: re-inserted characters