Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[JVM] Update the runtime PackedFunc for module #4871

Merged
merged 1 commit into from
Feb 12, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions jvm/core/src/main/java/org/apache/tvm/Module.java
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ protected Map<String, Function> initialValue() {
private static Function getApi(String name) {
Function func = apiFuncs.get().get(name);
if (func == null) {
func = Function.getFunction("module." + name);
func = Function.getFunction("runtime." + name);
apiFuncs.get().put(name, func);
}
return func;
Expand Down Expand Up @@ -126,7 +126,7 @@ public void importModule(Module module) {
* @return type key of the module.
*/
public String typeKey() {
return getApi("_GetTypeKey").pushArg(this).invoke().asString();
return getApi("ModuleGetTypeKey").pushArg(this).invoke().asString();
}

/**
Expand All @@ -137,7 +137,7 @@ public String typeKey() {
* @return The loaded module
*/
public static Module load(String path, String fmt) {
TVMValue ret = getApi("_LoadFromFile").pushArg(path).pushArg(fmt).invoke();
TVMValue ret = getApi("ModuleLoadFromFile").pushArg(path).pushArg(fmt).invoke();
assert ret.typeCode == TypeCode.MODULE_HANDLE;
return ret.asModule();
}
Expand All @@ -154,7 +154,7 @@ public static Module load(String path) {
* @return Whether runtime is enabled.
*/
public static boolean enabled(String target) {
TVMValue ret = getApi("_Enabled").pushArg(target).invoke();
TVMValue ret = getApi("RuntimeEnabled").pushArg(target).invoke();
return ret.asLong() != 0;
}
}