Mousius commented on a change in pull request #8280:
URL: https://github.com/apache/tvm/pull/8280#discussion_r674766363
##########
File path: src/target/source/source_module.cc
##########
@@ -220,37 +221,85 @@ class CSourceCrtMetadataModuleNode : public
runtime::ModuleNode {
code_ << "}\n";
}
- void GenerateEntrypointForPackedAPI(const std::string& run_func) {
+ void GenerateEntrypointForPackedAPI(const std::string& entrypoint_name,
+ const std::string& run_func) {
code_ << "TVM_DLL int32_t " << run_func;
code_ << "(void* args, void* type_code, int num_args, void* out_value,
void* "
"out_type_code, void* resource_handle);\n";
- code_ << "static int32_t " << ::tvm::runtime::symbol::tvm_module_main;
+ code_ << "int32_t " << entrypoint_name;
code_ << "(void* args, void* type_code, int num_args, void* out_value,
void* "
"out_type_code, void* resource_handle) {\n";
code_ << "return " << run_func;
code_ << "(args, type_code, num_args, out_value, out_type_code,
resource_handle);\n";
code_ << "}\n";
}
+ void GenerateCInterfaceEntrypoint(const std::string& entrypoint_name, const
std::string& run_func,
+ const std::string& mod_name) {
+ code_ << "#include <" << mod_name << ".h>\n";
Review comment:
Yip, it all resolves to a `tvmgen_` prefix, you can see this in the AOT
demo:
https://github.com/apache/tvm/pull/8280/files#diff-c552567d634f74cdf47534249b99f69d1cd99872b7af3b3773b9ccfbcaf13569R209
--
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]