Skip to content

Commit

Permalink
fix jni address cast bug
Browse files Browse the repository at this point in the history
  • Loading branch information
yuxianzhi authored Jul 29, 2022
1 parent fb9621f commit 33c2ad1
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions inference/engine/src/BoltModel_Jni.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ extern "C" JNIEXPORT jlong JNICALL BOLT_JNI_PREFIX(BoltModel_createModel)(
const char *affinityPtr = env->GetStringUTFChars(affinity, JNI_FALSE);
std::string affinity_str = (std::string)affinityPtr;
AFFINITY_TYPE affinity_cur = str2AFFINITY_TYPE(affinity_str);
long modelAddr = (long long)CreateModel(modelPathPtr, affinity_cur, NULL);
long long modelAddr = (long long)CreateModel(modelPathPtr, affinity_cur, NULL);
ModelHandleInfo *ihInfo = (ModelHandleInfo *)modelAddr;
if (nullptr == ihInfo) {
UNI_ERROR_LOG("Bolt instance not created\n");
Expand All @@ -285,7 +285,7 @@ extern "C" JNIEXPORT jlong JNICALL BOLT_JNI_PREFIX(BoltModel_cloneModel)(
UNI_DEBUG_LOG("JNI %s...\n", __FUNCTION__);
ModelHandle handle = (ModelHandle)modelAddr;
ModelHandle cloneHandle = CloneModel(handle);
long ret = (long long)cloneHandle;
long long ret = (long long)cloneHandle;
UNI_DEBUG_LOG("JNI %s end.\n", __FUNCTION__);
return ret;
}
Expand Down Expand Up @@ -433,7 +433,7 @@ extern "C" JNIEXPORT void JNICALL BOLT_JNI_PREFIX(BoltModel_setRuntimeDeviceDyna
UNI_DEBUG_LOG("JNI %s end.\n", __FUNCTION__);
}

extern "C" JNIEXPORT void JNICALL BOLT_JNI_PREFIX(BoltModel_setNumThreads)(JNIEnv *env, jint threads)
extern "C" JNIEXPORT void JNICALL BOLT_JNI_PREFIX(BoltModel_setNumThreads)(JNIEnv *env, jobject, jint threads)
{
UNI_DEBUG_LOG("JNI %s...\n", __FUNCTION__);
SetNumThreads(threads);
Expand Down

0 comments on commit 33c2ad1

Please sign in to comment.