How to enter char * text in int * in openCL

Can someone tell me how to attribute a char*pointer char*to int*in the OpenCL kernel function? I tried ((int*) char_pointer), but it does not work.

+3
source share
2 answers

I think you should qualify a pointer with the correct address space.

If you did not specify an address space, it is assumed __private, but your source pointer seems to be a pointer __global(from your comment), so the address spaces are incompatible.

So try using (__global int*)instead (int*).

+10
source

, char *, int *:

 union {
     char *cp;
     int  *ip;
 } ptr;

 ptr.cp = allocatedBuf;
 a[0] = *(ptr.ip);

, , C. undefined, , , ?

0

All Articles