Skip to content

Commit 83bdd69

Browse files
yzhliuwweic
authored andcommitted
[tvm4j] provide error msg for failure function call (apache#2967)
1 parent 6d21691 commit 83bdd69

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

jvm/native/src/main/native/ml_dmlc_tvm_native_c_api.cc

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -178,6 +178,10 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncCall(
178178
int ret = TVMFuncCall(reinterpret_cast<TVMFunctionHandle>(jhandle),
179179
&argValues[0], &argTypes[0], numArgs, &retVal, &retTypeCode);
180180

181+
if (ret != 0) {
182+
return ret;
183+
}
184+
181185
for (auto iter = pushedStrs.cbegin(); iter != pushedStrs.cend(); iter++) {
182186
env->ReleaseStringUTFChars(iter->first, iter->second);
183187
env->DeleteGlobalRef(iter->first);

0 commit comments

Comments
 (0)