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;
const cl_import_properties_arm import_properties =
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
The code looks correct. What is the value of errNum after the call to clImportMemoryARM?
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?
View all questions in Graphics and Gaming forum