Ubospica commented on issue #265: URL: https://github.com/apache/tvm-ffi/issues/265#issuecomment-3569510262
Thanks @junrushao and @tqchen for the insightful comments! On the overhead, I agree, we should be extra careful not to introduce additional overhead for overload resolution. I feel it is fine in principle because if the first overload function matches, the time consumption should be the same as the current impl. > I think the main goal is to NOT change the default path. Instead allow overload hidden under an ffi::Function that does dispatch inside This also makes sense. We should keep `ffi::Function` unchanged. We can have another `tvm::ffi::reflection::OverloadedFunction` that stores all overloads and handles the dispatching logic, and use `Function::FromPacked` to wrap it. One notable change is that, for the global and class-local function registration table, we also need to change from `Map<String, Function>` to `Map<String, OverloadedFunction>` to handle overloading. When functions are registered with the same name, we just add another overload. Thanks to @DarkSharpness, who helped with the design and could be helpful on the implementation. -- 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]
