From f0837aca78e6e484833c78c565f48e75c48d4ead Mon Sep 17 00:00:00 2001 From: tqchen Date: Tue, 5 Nov 2019 13:35:17 -0800 Subject: [PATCH] recover jvm support --- jvm/native/src/main/native/jni_helper_func.h | 38 ++++++++++---------- jvm/pom.xml | 4 +-- 2 files changed, 21 insertions(+), 21 deletions(-) diff --git a/jvm/native/src/main/native/jni_helper_func.h b/jvm/native/src/main/native/jni_helper_func.h index 0173278575337..d58224fb2f25f 100644 --- a/jvm/native/src/main/native/jni_helper_func.h +++ b/jvm/native/src/main/native/jni_helper_func.h @@ -27,7 +27,7 @@ // Helper functions for RefXXX getter & setter jlong getLongField(JNIEnv *env, jobject obj) { - jclass refClass = env->FindClass("ml/apache/incubator-tvm/Base$RefLong"); + jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefLong"); jfieldID refFid = env->GetFieldID(refClass, "value", "J"); jlong ret = env->GetLongField(obj, refFid); env->DeleteLocalRef(refClass); @@ -35,7 +35,7 @@ jlong getLongField(JNIEnv *env, jobject obj) { } jint getIntField(JNIEnv *env, jobject obj) { - jclass refClass = env->FindClass("ml/apache/incubator-tvm/Base$RefInt"); + jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefInt"); jfieldID refFid = env->GetFieldID(refClass, "value", "I"); jint ret = env->GetIntField(obj, refFid); env->DeleteLocalRef(refClass); @@ -43,21 +43,21 @@ jint getIntField(JNIEnv *env, jobject obj) { } void setIntField(JNIEnv *env, jobject obj, jint value) { - jclass refClass = env->FindClass("ml/apache/incubator-tvm/Base$RefInt"); + jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefInt"); jfieldID refFid = env->GetFieldID(refClass, "value", "I"); env->SetIntField(obj, refFid, value); env->DeleteLocalRef(refClass); } void setLongField(JNIEnv *env, jobject obj, jlong value) { - jclass refClass = env->FindClass("ml/apache/incubator-tvm/Base$RefLong"); + jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefLong"); jfieldID refFid = env->GetFieldID(refClass, "value", "J"); env->SetLongField(obj, refFid, value); env->DeleteLocalRef(refClass); } void setStringField(JNIEnv *env, jobject obj, const char *value) { - jclass refClass = env->FindClass("ml/apache/incubator-tvm/Base$RefString"); + jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefString"); jfieldID refFid = env->GetFieldID(refClass, "value", "Ljava/lang/String;"); env->SetObjectField(obj, refFid, env->NewStringUTF(value)); env->DeleteLocalRef(refClass); @@ -65,7 +65,7 @@ void setStringField(JNIEnv *env, jobject obj, const char *value) { // Helper functions for TVMValue jlong getTVMValueLongField(JNIEnv *env, jobject obj, - const char *clsname = "ml/apache/incubator-tvm/TVMValueLong") { + const char *clsname = "ml/dmlc/tvm/TVMValueLong") { jclass cls = env->FindClass(clsname); jfieldID fid = env->GetFieldID(cls, "value", "J"); jlong ret = env->GetLongField(obj, fid); @@ -74,7 +74,7 @@ jlong getTVMValueLongField(JNIEnv *env, jobject obj, } jdouble getTVMValueDoubleField(JNIEnv *env, jobject obj) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/TVMValueDouble"); + jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueDouble"); jfieldID fid = env->GetFieldID(cls, "value", "D"); jdouble ret = env->GetDoubleField(obj, fid); env->DeleteLocalRef(cls); @@ -82,7 +82,7 @@ jdouble getTVMValueDoubleField(JNIEnv *env, jobject obj) { } jstring getTVMValueStringField(JNIEnv *env, jobject obj) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/TVMValueString"); + jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueString"); jfieldID fid = env->GetFieldID(cls, "value", "Ljava/lang/String;"); jstring ret = static_cast(env->GetObjectField(obj, fid)); env->DeleteLocalRef(cls); @@ -90,7 +90,7 @@ jstring getTVMValueStringField(JNIEnv *env, jobject obj) { } jobject newTVMValueHandle(JNIEnv *env, jlong value) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/TVMValueHandle"); + jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueHandle"); jmethodID constructor = env->GetMethodID(cls, "", "(J)V"); jobject object = env->NewObject(cls, constructor, value); env->DeleteLocalRef(cls); @@ -98,7 +98,7 @@ jobject newTVMValueHandle(JNIEnv *env, jlong value) { } jobject newTVMValueLong(JNIEnv *env, jlong value) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/TVMValueLong"); + jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueLong"); jmethodID constructor = env->GetMethodID(cls, "", "(J)V"); jobject object = env->NewObject(cls, constructor, value); env->DeleteLocalRef(cls); @@ -106,7 +106,7 @@ jobject newTVMValueLong(JNIEnv *env, jlong value) { } jobject newTVMValueDouble(JNIEnv *env, jdouble value) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/TVMValueDouble"); + jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueDouble"); jmethodID constructor = env->GetMethodID(cls, "", "(D)V"); jobject object = env->NewObject(cls, constructor, value); env->DeleteLocalRef(cls); @@ -115,7 +115,7 @@ jobject newTVMValueDouble(JNIEnv *env, jdouble value) { jobject newTVMValueString(JNIEnv *env, const char *value) { jstring jvalue = env->NewStringUTF(value); - jclass cls = env->FindClass("ml/apache/incubator-tvm/TVMValueString"); + jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueString"); jmethodID constructor = env->GetMethodID(cls, "", "(Ljava/lang/String;)V"); jobject object = env->NewObject(cls, constructor, jvalue); env->DeleteLocalRef(cls); @@ -127,7 +127,7 @@ jobject newTVMValueBytes(JNIEnv *env, const TVMByteArray *arr) { jbyteArray jarr = env->NewByteArray(arr->size); env->SetByteArrayRegion(jarr, 0, arr->size, reinterpret_cast(const_cast(arr->data))); - jclass cls = env->FindClass("ml/apache/incubator-tvm/TVMValueBytes"); + jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueBytes"); jmethodID constructor = env->GetMethodID(cls, "", "([B)V"); jobject object = env->NewObject(cls, constructor, jarr); env->DeleteLocalRef(cls); @@ -136,7 +136,7 @@ jobject newTVMValueBytes(JNIEnv *env, const TVMByteArray *arr) { } jobject newModule(JNIEnv *env, jlong value) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/Module"); + jclass cls = env->FindClass("ml/dmlc/tvm/Module"); jmethodID constructor = env->GetMethodID(cls, "", "(J)V"); jobject object = env->NewObject(cls, constructor, value); env->DeleteLocalRef(cls); @@ -144,7 +144,7 @@ jobject newModule(JNIEnv *env, jlong value) { } jobject newFunction(JNIEnv *env, jlong value) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/Function"); + jclass cls = env->FindClass("ml/dmlc/tvm/Function"); jmethodID constructor = env->GetMethodID(cls, "", "(J)V"); jobject object = env->NewObject(cls, constructor, value); env->DeleteLocalRef(cls); @@ -152,7 +152,7 @@ jobject newFunction(JNIEnv *env, jlong value) { } jobject newNDArray(JNIEnv *env, jlong handle, jboolean isview) { - jclass cls = env->FindClass("ml/apache/incubator-tvm/NDArrayBase"); + jclass cls = env->FindClass("ml/dmlc/tvm/NDArrayBase"); jmethodID constructor = env->GetMethodID(cls, "", "(JZ)V"); jobject object = env->NewObject(cls, constructor, handle, isview); env->DeleteLocalRef(cls); @@ -168,7 +168,7 @@ jobject newObject(JNIEnv *env, const char *clsname) { } void fromJavaDType(JNIEnv *env, jobject jdtype, TVMType *dtype) { - jclass tvmTypeClass = env->FindClass("ml/apache/incubator-tvm/TVMType"); + jclass tvmTypeClass = env->FindClass("ml/dmlc/tvm/TVMType"); dtype->code = (uint8_t)(env->GetIntField(jdtype, env->GetFieldID(tvmTypeClass, "typeCode", "I"))); dtype->bits = (uint8_t)(env->GetIntField(jdtype, env->GetFieldID(tvmTypeClass, "bits", "I"))); dtype->lanes = (uint16_t)(env->GetIntField(jdtype, env->GetFieldID(tvmTypeClass, "lanes", "I"))); @@ -176,7 +176,7 @@ void fromJavaDType(JNIEnv *env, jobject jdtype, TVMType *dtype) { } void fromJavaContext(JNIEnv *env, jobject jctx, TVMContext *ctx) { - jclass tvmContextClass = env->FindClass("ml/apache/incubator-tvm/TVMContext"); + jclass tvmContextClass = env->FindClass("ml/dmlc/tvm/TVMContext"); ctx->device_type = static_cast(env->GetIntField(jctx, env->GetFieldID(tvmContextClass, "deviceType", "I"))); ctx->device_id = static_cast(env->GetIntField(jctx, @@ -206,7 +206,7 @@ jobject tvmRetValueToJava(JNIEnv *env, TVMValue value, int tcode) { case kBytes: return newTVMValueBytes(env, reinterpret_cast(value.v_handle)); case kNull: - return newObject(env, "ml/apache/incubator-tvm/TVMValueNull"); + return newObject(env, "ml/dmlc/tvm/TVMValueNull"); default: LOG(FATAL) << "Do NOT know how to handle return type code " << tcode; } diff --git a/jvm/pom.xml b/jvm/pom.xml index 797acf58f6db6..150c3a00a894d 100644 --- a/jvm/pom.xml +++ b/jvm/pom.xml @@ -7,7 +7,7 @@ tvm4j-parent 0.0.1-SNAPSHOT TVM4J Package - Parent - https://github.com/apache/incubator-tvm/tree/master/jvm + https://github.com/dmlc/tvm/tree/master/jvm TVM4J Package Distributed (Deep) Machine Learning Community @@ -22,7 +22,7 @@ scm:git:git@github.com:dmlc/tvm.git scm:git:git@github.com:dmlc/tvm.git - https://github.com/apache/incubator-tvm + https://github.com/dmlc/tvm