How to type-cast char* to int* in openCL

前端 未结 2 2051
礼貌的吻别
礼貌的吻别 2021-01-14 15:28

Can any one tell me how to typecast a char* pointer to int* in OpenCL kernel function?? I tried ((int*) char_pointer) but it is not wo

2条回答
  •  广开言路
    2021-01-14 16:01

    You have to qualify the pointer with the correct address space, I think.

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

    So try to use (__global int*) instead of just (int*).

提交回复
热议问题