junrushao commented on issue #338:
URL: https://github.com/apache/tvm-ffi/issues/338#issuecomment-3648008588

   It's indeed a useful direction worth considering. There used to be similar 
mechanism when integrating with TVM's NNVM compiler (@tqchen knows more 
details). Relying on `std::any` however, is not a good move, because `std::any` 
is built around RTTI, i.e. `typeid` / `std::type_info`, which is discouraged 
practice in a few major compiler infra IIRC. Therefore, we will likely need a 
better alternative mechanism in this case.
   
   Specifically on your usecase, if we only want to support zero-copy exchange 
with `cv::Mat`, the fastest approach is making it support [dlpack 
protocol](https://dmlc.github.io/dlpack/latest/python_spec.html), i.e. 
`__dlpack__`, `__dlpack_device__` and `from_dlpack`. Let me know your thoughts!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to