Commit 79cfab00 by tqchen Committed by Tianqi Chen

[JVM] Update the runtime PackedFunc for module

parent aaf62e47
...@@ -38,7 +38,7 @@ public class Module extends TVMValue { ...@@ -38,7 +38,7 @@ public class Module extends TVMValue {
private static Function getApi(String name) { private static Function getApi(String name) {
Function func = apiFuncs.get().get(name); Function func = apiFuncs.get().get(name);
if (func == null) { if (func == null) {
func = Function.getFunction("module." + name); func = Function.getFunction("runtime." + name);
apiFuncs.get().put(name, func); apiFuncs.get().put(name, func);
} }
return func; return func;
...@@ -126,7 +126,7 @@ public class Module extends TVMValue { ...@@ -126,7 +126,7 @@ public class Module extends TVMValue {
* @return type key of the module. * @return type key of the module.
*/ */
public String typeKey() { public String typeKey() {
return getApi("_GetTypeKey").pushArg(this).invoke().asString(); return getApi("ModuleGetTypeKey").pushArg(this).invoke().asString();
} }
/** /**
...@@ -137,7 +137,7 @@ public class Module extends TVMValue { ...@@ -137,7 +137,7 @@ public class Module extends TVMValue {
* @return The loaded module * @return The loaded module
*/ */
public static Module load(String path, String fmt) { 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; assert ret.typeCode == TypeCode.MODULE_HANDLE;
return ret.asModule(); return ret.asModule();
} }
...@@ -154,7 +154,7 @@ public class Module extends TVMValue { ...@@ -154,7 +154,7 @@ public class Module extends TVMValue {
* @return Whether runtime is enabled. * @return Whether runtime is enabled.
*/ */
public static boolean enabled(String target) { public static boolean enabled(String target) {
TVMValue ret = getApi("_Enabled").pushArg(target).invoke(); TVMValue ret = getApi("RuntimeEnabled").pushArg(target).invoke();
return ret.asLong() != 0; return ret.asLong() != 0;
} }
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment