Skip to content

Commit

Permalink
fixup! Add AOT code-generation.
Browse files Browse the repository at this point in the history
  • Loading branch information
areusch committed Feb 18, 2022
1 parent 8249bf1 commit 20fa726
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/target/metadata_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -124,15 +124,17 @@ static runtime::Module CreateCppMetadataModule(
target_module = const_loader_mod;
}

runtime::metadata::Metadata runtime_metadata = ConvertMetaData(metadata);

if (metadata->executor == runtime::kTvmExecutorAot && runtime->name == relay::kTvmRuntimeCpp) {
if (target->kind->name == "c") {
auto metadata_module = CreateCSourceCppMetadataModule(runtime_metadata);
metadata_module->Import(target_module);
target_module = metadata_module;
} else {
CHECK(false) << "Don't know how to create MetadataModule for target type " << target->str();
if (metadata.defined()) {
runtime::metadata::Metadata runtime_metadata = ConvertMetaData(metadata);

if (metadata->executor == runtime::kTvmExecutorAot && runtime->name == relay::kTvmRuntimeCpp) {
if (target->kind->name == "c") {
auto metadata_module = CreateCSourceCppMetadataModule(runtime_metadata);
metadata_module->Import(target_module);
target_module = metadata_module;
} else {
CHECK(false) << "Don't know how to create MetadataModule for target type " << target->str();
}
}
}

Expand Down

0 comments on commit 20fa726

Please sign in to comment.