c_backend_api.h
6.03 KB
-
[RUNTIME][DSO] Improve TVMBackendPackedCFunc to allow return val (#4637) · 77c47748
* [RUNTIME][DSO] Improve TVMBackendPackedCFunc to allow return value. Previously the signature of LibraryModule's PackedFunc does not support return value. This wasn't a limitation for our current usecase but could become one as we start to generate more interesting functions. This feature also start to get interesting as we move towards unified object protocol and start to pass object around. This PR enhances the function signature to allow return values. We also created two macros TVM_DLL_EXPORT_PACKED_FUNC and TVM_DLL_EXPORT_TYPED_FUNC to allow manual creation of functions that can be loaded by a LibraryModule. Examples are added in apps/dso_plugin_module. The change to TVMBackendPackedCFunc is backward compatible, as previous function will simply ignore the return value field. * address review comments
Tianqi Chen committed