DarkSharpness commented on issue #265:
URL: https://github.com/apache/tvm-ffi/issues/265#issuecomment-3573733270

   I'm not sure whether my [demo 
implementation](https://github.com/DarkSharpness/tvm-ffi/commit/15a71a4f21d096afdf979b69fb99fbe86cd7dc2c)
 satisfy these constraints. I only introduced a static member function 
`FromOverloaded` to the `ffi::Function`, which can be further hidden to 
private. The implementation is based on passing a closure into the 
`ffi::Function`, which avoids too much intrusive modification in `ffi::Function`
   
   This is a dynamic-style overload, which might be slightly slower in overload 
path (when there's no overload, it will fallback to `unpack_call`, no 
performance loss).
   
   For ObjectDef, it's easy to integrate since we cannot have more than 1 
ObjectDef for the same class. We can use a mapping to track all the overload. 
For GlobalDef, I agree it's much more tricky and need something like a global 
dispatcher.


-- 
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