cancel
Showing results for 
Search instead for 
Did you mean: 

Archives Discussions

jpsollie
Adept II

opencl compiler error (segmentation fault)

Jump to solution

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():

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;     }

}

while the following runs fine:

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;

     }

}

any ideas what is happening? thank you!

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

0 Likes
1 Solution

Accepted Solutions
dipak
Staff
Staff

Re: opencl compiler error (segmentation fault)

Jump to solution

I think the error is due to the following line:

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

If a null string needs to be passed, I guess, you may simply call the function as below:

Updatec(context, 0, 1);

Regards,

View solution in original post

0 Likes
1 Reply
dipak
Staff
Staff

Re: opencl compiler error (segmentation fault)

Jump to solution

I think the error is due to the following line:

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

If a null string needs to be passed, I guess, you may simply call the function as below:

Updatec(context, 0, 1);

Regards,

View solution in original post

0 Likes