Skip to content

Commit

Permalink
[tvm4j] provide error msg for failure function call (apache#2967)
Browse files Browse the repository at this point in the history
  • Loading branch information
yzhliu authored and wweic committed Apr 7, 2019
1 parent 1809dd3 commit 49dfe08
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions jvm/native/src/main/native/ml_dmlc_tvm_native_c_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncCall(
int ret = TVMFuncCall(reinterpret_cast<TVMFunctionHandle>(jhandle),
&argValues[0], &argTypes[0], numArgs, &retVal, &retTypeCode);

if (ret != 0) {
return ret;
}

for (auto iter = pushedStrs.cbegin(); iter != pushedStrs.cend(); iter++) {
env->ReleaseStringUTFChars(iter->first, iter->second);
env->DeleteGlobalRef(iter->first);
Expand Down

0 comments on commit 49dfe08

Please sign in to comment.