in src/dlr_common.cc [112:129]
DLRBackend dlr::GetBackend(const std::vector<std::string>& files) {
// Scan files to guess the backend.
bool has_tvm_lib = false;
for (auto filename : files) {
if (EndsWith(filename, ".params")) {
return DLRBackend::kTVM;
} else if (EndsWith(filename, ".ro")) {
return DLRBackend::kRELAYVM;
} else if (EndsWith(filename, "_hexagon_model.so")) {
return DLRBackend::kHEXAGON;
} else if (!EndsWith(filename, LIBDLR) && EndsWith(filename, LIBEXT)) {
has_tvm_lib =
true; // dont return immediately since it could be part of many diff backend types
}
}
if (has_tvm_lib) return DLRBackend::kTREELITE;
return DLRBackend::kUNKNOWN;
}