tqchen commented on a change in pull request #7919:
URL: https://github.com/apache/tvm/pull/7919#discussion_r624549140



##########
File path: include/tvm/runtime/c_backend_api.h
##########
@@ -99,6 +100,19 @@ TVM_DLL void* TVMBackendAllocWorkspace(int device_type, int 
device_id, uint64_t
  */
 TVM_DLL int TVMBackendFreeWorkspace(int device_type, int device_id, void* ptr);
 
+/*!
+ * \brief Backend function to register execution environment(e.g. python)
+ *        specific C APIs.
+ *
+ * \note  We only register the C API function when absolutely necessary (e.g. 
when signal handler
+ *  cannot trap back into python). In most cases we should use the PackedFunc 
FFI.
+ *
+ * \param name The name of the symbol
+ * \param ptr The symbol address.
+ * \return 0 when no error is thrown, -1 when failure happens
+ */
+TVM_DLL int TVMBackendRegisterEnvCAPI(const char* name, void* ptr);

Review comment:
       The particular API can be useful for future registrations. One potential 
candidate is PyInitialize, for initializing python callback support in 
multi-threaded setting
   
   




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

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


Reply via email to