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

Problems about zero copy clImportMemoryARM

Hi

    I am trying to malloc a buffer and use it to achieve zero copy between cpu and mali gpu. The device is Redmi Note8pro, Mali G76 MC4, opencl 2.1, ddk

Opencl 2.1 v1.r20p0-01rel0.a41d1d553047de7edc8f79dbe3e575cd, android 10. The cl extension include cl_arm_import_memory_host. The code snippet is shown below:  

int8_t* src = new int8_t[256];
const cl_import_properties_arm import_properties[] =
{
	CL_IMPORT_TYPE_ARM,
    CL_IMPORT_TYPE_HOST_ARM,
    0
};
cl_int errNum;
cl_mem d_src = clImportMemoryARM(context, CL_MEM_READ_WRITE, import_properties, src, 256, &errNum);

  However, the value of d_src is 0x0, and the cl kernel will crash if access the d_src. 

  Would you please help with the issue? Thanks