This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

clImportMemoryARM return CL_OUT_OF_HOST_MEMORY

The code is like this:


cl_mem buffer = clImportMemoryARM(context,
CL_MEM_READ_WRITE,
NULL,
ptr,
size,
&err);

if ptr is a newly malloc buffer pointer, like

char* ptr = (char*)malloc(size);
it works fine.
However, when passing into a third party library pointer (accessible from CPU), let's call it coolPtr, it will return error code -6, which is CL_OUT_OF_HOST_MEMORY
cl_mem buffer = clImportMemoryARM(context,
CL_MEM_READ_WRITE,
NULL,
coolPtr,
size,
&err);
I can do other operations with coolPtr successfully, like I can
memcpy(dstPtr, coolPtr, size);
Then why does the clImportMemoryARM fail for coolPtr? Thanks!
  • It may depend on the clImportMemoryARM() implementation about the memory attribute check.

    Possibly, the third-party library pointer has different memory attributes (read/write/execute/shareability/cacheability) from newly malloced buffer pointer "ptr".