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
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
errNum is CL_SUCCESS.
This is very weird, if the errNum is set to be -1, after calling clImportMemoryARM, it is still -1.
Weird indeed. Looking at the source code, this doesn't seem to be possible. Do you still have this issue?
Do you really need imported memory in your application? If you are in control of the producer code, nothing prevents you from creating a buffer and mapping it for initialisation. This will not result in a copy.
In case you do need imported memory, do you have access to Arm support?
Regards,
Kevin