cancel
Showing results for 
Search instead for 
Did you mean: 

OpenCL

Zee1
Journeyman III

Equivalent opencl commands.

Hi

I'm working on porting some C code to OpenCL and I'm struggling to find equivalent commands in OpenCL

 

The first issue is I'm reading a buffer that is counting up in hex however I need to prefix with up to 10 zeros, for example

Buffer: AF

Var: 00000000AF

In my C code I've used:

sprintf(decstring, "%010llx\n", x)

and that works fine for my use, is there an equivalent way to do that in OpenCL?

 

 

My second question is how to split the var into an array containing pairs of characters in decimal. For example:

Var: 1234567890

Becomes:

arr[5] = {18, 52, 86, 120, 144}

In my code I used the following that works well:

sscanf(pos, "%2hhx", &val[count]);

 

If anyone could point me in the right direction that would be great, thanks.

0 Kudos
Reply