AnsweredAssumed Answered

opencl compiler error (segmentation fault)

Question asked by jpsollie on Jan 23, 2017
Latest reply on Jan 25, 2017 by dipak

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

Outcomes