Hi @srkreddy1238,
I’m trying to achieve zero copy of my input data using OPENCL Host ptr support. However I don’t want to create a new EMPTY NDARRAY as the input data is already allocated.
Currently, I’ve modified the AllocDataSpace()
(to create cl mem from existing data ptr using flag CL_MEM_USE_HOST_PTR
) exposed it as a packed func to use it directly. With this I’m able to successfully execute with zero copy.
But I have few queries.
- The BufferDescriptor ptr returned by allocatedataspace is not aligned with KAllocAlign value so I need to turn off TVMAlignChecks when using
NdArray::FromDLPack()
. - Is there a better / optimal way to handle this zero copy?
- is there a plan to include OpenCLWorkspace class to tvm/include folder. Currently, I need to expose as packedFunc and register the same. (same case for
GetNativePtr()
)