You will need [JDK](http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html), [Android SDK](https://developer.android.com/studio/index.html), [Android NDK](https://developer.android.com/ndk) and an Android device to use this. Make sure the `ANDROID_HOME` variable already points to your Android SDK folder or set it using `export ANDROID_HOME=[Path to your Android SDK, e.g., ~/Android/sdk]`. We use [Gradle](https://gradle.org) to build. Please follow [the installation instruction](https://gradle.org/install) for your operating system.
-Alternatively, you may execute Docker image we provide wich contains the required packages. Use the command below to build the image and enter interactive session. Note, that building with OpenCL was not tested from Docker.
+Alternatively, you may execute Docker image we provide which contains the required packages. Use the command below to build the image and enter interactive session. Note, that building with OpenCL was not tested from Docker.
```bash
./docker/build.sh demo_android -it bash
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
- compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
+ compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
```
Follow instruction to get compiled version model for android target [here.](http://docs.tvm.ai/deploy/android.html)
-Copied these compiled model deploy_lib.so, deploy_graph.json and deploy_param.params to apps/android_deploy/app/src/main/assets/ and modify TVM flavor changes on [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java#L81)
+Copied these compiled model deploy_lib.so, deploy_graph.json and deploy_param.params to apps/android_deploy/app/src/main/assets/ and modify TVM flavor changes on [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java#L81)
`CPU Verison flavor`
```
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
- applicationId "ml.dmlc.tvm.android.demo"
+ applicationId "org.apache.tvm.android.demo"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
- compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
+ compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="ml.dmlc.tvm.android.demo" >
+ package="org.apache.tvm.android.demo" >
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>
android:supportsRtl="true"
android:theme="@style/AppTheme" >
<activity
- android:name=".MainActivity"
+ android:name="org.apache.tvm.android.demo.MainActivity"
android:label="@string/app_name"
android:theme="@style/AppTheme.NoActionBar"
android:screenOrientation="portrait">
* limitations under the License.
*/
-package ml.dmlc.tvm.android.demo;
+package org.apache.tvm.android.demo;
import android.Manifest;
import android.content.Intent;
import java.util.Date;
import java.util.Vector;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.NDArray;
-import ml.dmlc.tvm.TVMContext;
-import ml.dmlc.tvm.TVMValue;
-import ml.dmlc.tvm.TVMType;
+import org.apache.tvm.Function;
+import org.apache.tvm.Module;
+import org.apache.tvm.NDArray;
+import org.apache.tvm.TVMContext;
+import org.apache.tvm.TVMValue;
+import org.apache.tvm.TVMType;
public class MainActivity extends AppCompatActivity {
private static final String TAG = MainActivity.class.getSimpleName();
include $(config)
-LOCAL_SRC_FILES := ml_dmlc_tvm_native_c_api.cc
+LOCAL_SRC_FILES := org_apache_tvm_native_c_api.cc
LOCAL_LDFLAGS := -L$(SYSROOT)/usr/lib/ -llog
LOCAL_C_INCLUDES := $(ROOT_PATH)/include \
PATH="$PATH:/usr/local/bin"
CURR_DIR=$(cd `dirname $0`; pwd)
ROOT_DIR="$CURR_DIR/../../../../../.."
-javah -o $CURR_DIR/ml_dmlc_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" ml.dmlc.tvm.LibInfo || exit -1
-cp -f $ROOT_DIR/jvm/native/src/main/native/ml_dmlc_tvm_native_c_api.cc $CURR_DIR/ || exit -1
+javah -o $CURR_DIR/org_apache_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" org.apache.tvm.LibInfo || exit -1
+cp -f $ROOT_DIR/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc $CURR_DIR/ || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/jni_helper_func.h $CURR_DIR/ || exit -1
rm -rf $CURR_DIR/../libs
ndk-build --directory=$CURR_DIR
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context="ml.dmlc.tvm.android.demo.MainActivity">
+ tools:context="org.apache.tvm.android.demo.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
--- /dev/null
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements. See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership. The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License. You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied. See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+org.gradle.jvmargs=-Xmx4096M
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
- compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
+ compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
```
adb: failed to install app/build/outputs/apk/release/tvmrpc-release.apk:
Failure [INSTALL_FAILED_UPDATE_INCOMPATIBLE:
- Package ml.dmlc.tvm.tvmrpc signatures do not match the previously installed version; ignoring!]
+ Package org.apache.tvm.tvmrpc signatures do not match the previously installed version; ignoring!]
Run uninstall first:
```bash
-$ANDROID_HOME/platform-tools/adb uninstall ml.dmlc.tvm.tvmrpc
+$ANDROID_HOME/platform-tools/adb uninstall org.apache.tvm.tvmrpc
```
### Build with OpenCL
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
- applicationId "ml.dmlc.tvm.tvmrpc"
+ applicationId "org.apache.tvm.tvmrpc"
minSdkVersion 24
targetSdkVersion 26
versionCode 1
compile 'com.android.support:appcompat-v7:26.0.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.android.support:design:26.0.1'
- compile 'ml.dmlc.tvm:tvm4j-core:0.0.1-SNAPSHOT'
+ compile 'org.apache.tvm:tvm4j-core:0.0.1-SNAPSHOT'
testCompile 'junit:junit:4.12'
}
-->
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
- package="ml.dmlc.tvm.tvmrpc" >
+ package="org.apache.tvm.tvmrpc" >
<uses-permission android:name="android.permission.INTERNET" />
* limitations under the License.
*/
-package ml.dmlc.tvm.tvmrpc;
+package org.apache.tvm.tvmrpc;
-import android.annotation.SuppressLint;
import android.app.AlertDialog;
import android.content.Context;
import android.content.DialogInterface;
import android.content.SharedPreferences;
import android.os.Bundle;
import android.os.Handler;
-import android.os.Message;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.widget.CompoundButton;
import android.widget.EditText;
import android.widget.Switch;
-import android.widget.Button;
-import android.view.View;
import android.content.Intent;
-import android.app.NotificationChannel;
-import android.app.NotificationManager;
public class MainActivity extends AppCompatActivity {
* limitations under the License.
*/
-package ml.dmlc.tvm.tvmrpc;
+package org.apache.tvm.tvmrpc;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
* limitations under the License.
*/
-package ml.dmlc.tvm.tvmrpc;
+package org.apache.tvm.tvmrpc;
import android.os.ParcelFileDescriptor;
import java.net.Socket;
-import ml.dmlc.tvm.rpc.ConnectTrackerServerProcessor;
-import ml.dmlc.tvm.rpc.RPCWatchdog;
+import org.apache.tvm.rpc.ConnectTrackerServerProcessor;
+import org.apache.tvm.rpc.RPCWatchdog;
/**
* Connect to RPC proxy and deal with requests.
include $(config)
-LOCAL_SRC_FILES := ml_dmlc_tvm_native_c_api.cc
+LOCAL_SRC_FILES := org_apache_tvm_native_c_api.cc
LOCAL_LDFLAGS := -L$(SYSROOT)/usr/lib/ -llog
LOCAL_C_INCLUDES := $(ROOT_PATH)/include \
PATH="$PATH:/usr/local/bin"
CURR_DIR=$(cd `dirname $0`; pwd)
ROOT_DIR="$CURR_DIR/../../../../../.."
-javah -o $CURR_DIR/ml_dmlc_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" ml.dmlc.tvm.LibInfo || exit -1
-cp -f $ROOT_DIR/jvm/native/src/main/native/ml_dmlc_tvm_native_c_api.cc $CURR_DIR/ || exit -1
+javah -o $CURR_DIR/org_apache_tvm_native_c_api.h -cp "$ROOT_DIR/jvm/core/target/*" org.apache.tvm.LibInfo || exit -1
+cp -f $ROOT_DIR/jvm/native/src/main/native/org_apache_tvm_native_c_api.cc $CURR_DIR/ || exit -1
cp -f $ROOT_DIR/jvm/native/src/main/native/jni_helper_func.h $CURR_DIR/ || exit -1
rm -rf $CURR_DIR/../libs
ndk-build --directory=$CURR_DIR
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context="ml.dmlc.tvm.tvmrpc.MainActivity">
+ tools:context="org.apache.tvm.tvmrpc.MainActivity">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
- tools:context="ml.dmlc.tvm.tvmrpc.RPCActivity">
+ tools:context="org.apache.tvm.tvmrpc.RPCActivity">
<android.support.design.widget.AppBarLayout
android:layout_height="wrap_content"
import re
default_team_id = "3FR42MXLK9"
-default_bundle_identifier = 'ml.dmlc.tvmrpc'
+default_bundle_identifier = 'org.apache.tvmrpc'
parser = argparse.ArgumentParser(description='Update tvmrpc.xcodeproj\
developer information')
);
INFOPLIST_FILE = tvmrpc/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpc;
+ PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpc;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Debug;
);
INFOPLIST_FILE = tvmrpc/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpc;
+ PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpc;
PRODUCT_NAME = "$(TARGET_NAME)";
};
name = Release;
);
INFOPLIST_FILE = tvmrpcLauncher/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpcLauncher;
+ PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpcLauncher;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tvmrpc.app/tvmrpc";
};
);
INFOPLIST_FILE = tvmrpcLauncher/Info.plist;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks @loader_path/Frameworks";
- PRODUCT_BUNDLE_IDENTIFIER = ml.dmlc.tvmrpcLauncher;
+ PRODUCT_BUNDLE_IDENTIFIER = org.apache.tvmrpcLauncher;
PRODUCT_NAME = "$(TARGET_NAME)";
TEST_HOST = "$(BUILT_PRODUCTS_DIR)/tvmrpc.app/tvmrpc";
};
## TVM Runtime for Android Target
Refer [here](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/README.md#build-and-installation) to build CPU/OpenCL version flavor TVM runtime for android target.
-From android java TVM API to load model & execute can be referred at this [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/ml/dmlc/tvm/android/demo/MainActivity.java) sample source.
+From android java TVM API to load model & execute can be referred at this [java](https://github.com/apache/incubator-tvm/blob/master/apps/android_deploy/app/src/main/java/org/apache/tvm/android/demo/MainActivity.java) sample source.
The following code snippet demonstrate how to load generated shared library (add_cpu.so).
```java
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.NDArray;
-import ml.dmlc.tvm.TVMContext;
+import org.apache.tvm.Module;
+import org.apache.tvm.NDArray;
+import org.apache.tvm.TVMContext;
import java.io.File;
import java.util.Arrays;
server.start();
```
-You can also use `StandaloneServerProcessor` and `ConnectProxyServerProcessor` to build your own RPC server. Refer to [Android RPC Server](https://github.com/apache/incubator-tvm/blob/master/apps/android_rpc/app/src/main/java/ml/dmlc/tvm/tvmrpc/RPCProcessor.java) for more details.
\ No newline at end of file
+You can also use `StandaloneServerProcessor` and `ConnectProxyServerProcessor` to build your own RPC server. Refer to [Android RPC Server](https://github.com/apache/incubator-tvm/blob/master/apps/android_rpc/app/src/main/java/org/apache/tvm/tvmrpc/RPCProcessor.java) for more details.
\ No newline at end of file
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-full-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-full-linux-x86_64</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TVM4J Package - Full Linux-x86_64</name>
<dependencies>
<dependency>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>libtvm4j-linux-x86_64</artifactId>
<version>${project.version}</version>
<type>so</type>
<useProjectArtifact>false</useProjectArtifact>
<useStrictFiltering>false</useStrictFiltering>
<includes>
- <include>ml.dmlc.tvm:libtvm4j-linux-x86_64:so</include>
+ <include>org.apache.tvm:libtvm4j-linux-x86_64:so</include>
</includes>
</dependencySet>
</dependencySets>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-full-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-full-osx-x86_64</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TVM4J Package - Full OSX-x86_64</name>
<dependencies>
<dependency>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>libtvm4j-osx-x86_64</artifactId>
<version>${project.version}</version>
<type>jnilib</type>
<useProjectArtifact>false</useProjectArtifact>
<useStrictFiltering>false</useStrictFiltering>
<includes>
- <include>ml.dmlc.tvm:libtvm4j-osx-x86_64:jnilib</include>
+ <include>org.apache.tvm:libtvm4j-osx-x86_64:jnilib</include>
</includes>
</dependencySet>
</dependencySets>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-full-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TVM4J Package - Full Parent</name>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TVM4J Package - Core</name>
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import java.util.HashMap;
import java.util.Map;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
/**
* Internal api functions.
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
-import ml.dmlc.tvm.NativeLibraryLoader.Action;
+import org.apache.tvm.NativeLibraryLoader.Action;
import java.io.File;
import java.io.IOException;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import java.util.ArrayList;
import java.util.Collections;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import java.util.List;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import java.util.HashMap;
import java.util.Map;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
/**
* Base class of NDArray. To handle callback array.
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import java.io.File;
import java.io.FileInputStream;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
-import ml.dmlc.tvm.rpc.RPC;
+import org.apache.tvm.rpc.RPC;
import java.util.HashMap;
import java.util.Map;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
public class TVMType {
public static final int INT = 0;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
public class TVMValue {
public final TypeCode typeCode;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
public class TVMValueBytes extends TVMValue {
public final byte[] value;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
public class TVMValueDouble extends TVMValue {
public final double value;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
/**
* Java class related to TVM handles (TypeCode.HANDLE)
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
public class TVMValueLong extends TVMValue {
public final long value;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
public class TVMValueNull extends TVMValue {
public TVMValueNull() {
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
public class TVMValueString extends TVMValue {
public final String value;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
// Type code used in API calls
public enum TypeCode {
* under the License.
*/
-package ml.dmlc.tvm.contrib;
+package org.apache.tvm.contrib;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.NDArray;
-import ml.dmlc.tvm.TVMContext;
+import org.apache.tvm.Function;
+import org.apache.tvm.Module;
+import org.apache.tvm.NDArray;
+import org.apache.tvm.TVMContext;
/**
* Wrapper runtime module.
* limitations under the License.
*/
-package ml.dmlc.tvm.contrib;
+package org.apache.tvm.contrib;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.TVMContext;
-import ml.dmlc.tvm.TVMValue;
-import ml.dmlc.tvm.rpc.RPC;
-import ml.dmlc.tvm.rpc.RPCSession;
-import ml.dmlc.tvm.rpc.TVMRemoteContext;
+import org.apache.tvm.Function;
+import org.apache.tvm.Module;
+import org.apache.tvm.TVMContext;
+import org.apache.tvm.TVMValue;
+import org.apache.tvm.rpc.RPC;
+import org.apache.tvm.rpc.RPCSession;
+import org.apache.tvm.rpc.TVMRemoteContext;
import java.lang.reflect.Field;
import java.lang.reflect.InvocationTargetException;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.TVMValue;
+import org.apache.tvm.Function;
+import org.apache.tvm.TVMValue;
public class Client {
/**
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
import java.io.InputStream;
import java.io.OutputStream;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
import java.io.IOException;
import java.io.InputStream;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.TVMValue;
+import org.apache.tvm.Function;
+import org.apache.tvm.Module;
+import org.apache.tvm.TVMValue;
import java.io.File;
import java.io.IOException;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
-import ml.dmlc.tvm.Function;
+import org.apache.tvm.Function;
import java.util.HashMap;
import java.util.Map;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.TVMContext;
+import org.apache.tvm.Function;
+import org.apache.tvm.Module;
+import org.apache.tvm.TVMContext;
import java.io.File;
import java.io.FileInputStream;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
/**
* Watchdog for RPC.
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
import java.io.IOException;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
/**
* Abstract runnable class for RPC server process.
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.TVMValue;
-import ml.dmlc.tvm.TVMValueBytes;
+import org.apache.tvm.Function;
+import org.apache.tvm.TVMValue;
+import org.apache.tvm.TVMValueBytes;
import java.io.IOException;
import java.net.Socket;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
import java.io.IOException;
import java.io.InputStream;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
-import ml.dmlc.tvm.TVMContext;
+import org.apache.tvm.TVMContext;
// always related to RPCSession. Cannot construct by users.
public class TVMRemoteContext extends TVMContext {
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
import java.io.IOException;
import java.io.InputStream;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import org.junit.Test;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import org.junit.BeforeClass;
import org.junit.Test;
* limitations under the License.
*/
-package ml.dmlc.tvm;
+package org.apache.tvm;
import org.junit.Test;
-package ml.dmlc.tvm;
+package org.apache.tvm;
/*
* Licensed to the Apache Software Foundation (ASF) under one
*/
-import ml.dmlc.tvm.rpc.Server;
+import org.apache.tvm.rpc.Server;
import java.io.IOException;
* limitations under the License.
*/
-package ml.dmlc.tvm.contrib;
-
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.NDArray;
-import ml.dmlc.tvm.TVMContext;
-import ml.dmlc.tvm.TestUtils;
-import ml.dmlc.tvm.rpc.Client;
-import ml.dmlc.tvm.rpc.RPCSession;
-import ml.dmlc.tvm.rpc.Server;
+package org.apache.tvm.contrib;
+
+import org.apache.tvm.Module;
+import org.apache.tvm.NDArray;
+import org.apache.tvm.TVMContext;
+import org.apache.tvm.TestUtils;
+import org.apache.tvm.rpc.Client;
+import org.apache.tvm.rpc.RPCSession;
+import org.apache.tvm.rpc.Server;
import org.junit.BeforeClass;
import org.junit.Test;
import org.slf4j.Logger;
* limitations under the License.
*/
-package ml.dmlc.tvm.rpc;
+package org.apache.tvm.rpc;
-import ml.dmlc.tvm.Function;
-import ml.dmlc.tvm.Module;
-import ml.dmlc.tvm.TVMValue;
-import ml.dmlc.tvm.TestUtils;
+import org.apache.tvm.Function;
+import org.apache.tvm.Module;
+import org.apache.tvm.TVMValue;
+import org.apache.tvm.TestUtils;
import org.junit.Ignore;
import org.junit.Test;
import org.slf4j.Logger;
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-native-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
<dependencies>
<dependency>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
<source>
<directory>../src/main/native</directory>
<fileNames>
- <fileName>ml_dmlc_tvm_native_c_api.cc</fileName>
+ <fileName>org_apache_tvm_native_c_api.cc</fileName>
</fileNames>
</source>
</sources>
<javahProvider>default</javahProvider>
<javahOutputDirectory>${project.build.directory}/custom-javah</javahOutputDirectory>
<workingDirectory>${basedir}</workingDirectory>
- <javahOutputFileName>ml_dmlc_tvm_native_c_api.h</javahOutputFileName>
+ <javahOutputFileName>org_apache_tvm_native_c_api.h</javahOutputFileName>
<javahClassNames>
- <javahClassName>ml.dmlc.tvm.LibInfo</javahClassName>
+ <javahClassName>org.apache.tvm.LibInfo</javahClassName>
</javahClassNames>
</configuration>
<goals>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-native-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
<dependencies>
<dependency>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
<source>
<directory>../src/main/native</directory>
<fileNames>
- <fileName>ml_dmlc_tvm_native_c_api.cc</fileName>
+ <fileName>org_apache_tvm_native_c_api.cc</fileName>
</fileNames>
</source>
</sources>
<javahProvider>default</javahProvider>
<javahOutputDirectory>${project.build.directory}/custom-javah</javahOutputDirectory>
<workingDirectory>${basedir}</workingDirectory>
- <javahOutputFileName>ml_dmlc_tvm_native_c_api.h</javahOutputFileName>
+ <javahOutputFileName>org_apache_tvm_native_c_api.h</javahOutputFileName>
<javahClassNames>
- <javahClassName>ml.dmlc.tvm.LibInfo</javahClassName>
+ <javahClassName>org.apache.tvm.LibInfo</javahClassName>
</javahClassNames>
</configuration>
<goals>
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
// Helper functions for RefXXX getter & setter
jlong getLongField(JNIEnv *env, jobject obj) {
- jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefLong");
+ jclass refClass = env->FindClass("org/apache/tvm/Base$RefLong");
jfieldID refFid = env->GetFieldID(refClass, "value", "J");
jlong ret = env->GetLongField(obj, refFid);
env->DeleteLocalRef(refClass);
}
jint getIntField(JNIEnv *env, jobject obj) {
- jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefInt");
+ jclass refClass = env->FindClass("org/apache/tvm/Base$RefInt");
jfieldID refFid = env->GetFieldID(refClass, "value", "I");
jint ret = env->GetIntField(obj, refFid);
env->DeleteLocalRef(refClass);
}
void setIntField(JNIEnv *env, jobject obj, jint value) {
- jclass refClass = env->FindClass("ml/dmlc/tvm/Base$RefInt");
+ jclass refClass = env->FindClass("org/apache/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/dmlc/tvm/Base$RefLong");
+ jclass refClass = env->FindClass("org/apache/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/dmlc/tvm/Base$RefString");
+ jclass refClass = env->FindClass("org/apache/tvm/Base$RefString");
jfieldID refFid = env->GetFieldID(refClass, "value", "Ljava/lang/String;");
env->SetObjectField(obj, refFid, env->NewStringUTF(value));
env->DeleteLocalRef(refClass);
// Helper functions for TVMValue
jlong getTVMValueLongField(JNIEnv *env, jobject obj,
- const char *clsname = "ml/dmlc/tvm/TVMValueLong") {
+ const char *clsname = "org/apache/tvm/TVMValueLong") {
jclass cls = env->FindClass(clsname);
jfieldID fid = env->GetFieldID(cls, "value", "J");
jlong ret = env->GetLongField(obj, fid);
}
jdouble getTVMValueDoubleField(JNIEnv *env, jobject obj) {
- jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueDouble");
+ jclass cls = env->FindClass("org/apache/tvm/TVMValueDouble");
jfieldID fid = env->GetFieldID(cls, "value", "D");
jdouble ret = env->GetDoubleField(obj, fid);
env->DeleteLocalRef(cls);
}
jstring getTVMValueStringField(JNIEnv *env, jobject obj) {
- jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueString");
+ jclass cls = env->FindClass("org/apache/tvm/TVMValueString");
jfieldID fid = env->GetFieldID(cls, "value", "Ljava/lang/String;");
jstring ret = static_cast<jstring>(env->GetObjectField(obj, fid));
env->DeleteLocalRef(cls);
}
jobject newTVMValueHandle(JNIEnv *env, jlong value) {
- jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueHandle");
+ jclass cls = env->FindClass("org/apache/tvm/TVMValueHandle");
jmethodID constructor = env->GetMethodID(cls, "<init>", "(J)V");
jobject object = env->NewObject(cls, constructor, value);
env->DeleteLocalRef(cls);
}
jobject newTVMValueLong(JNIEnv *env, jlong value) {
- jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueLong");
+ jclass cls = env->FindClass("org/apache/tvm/TVMValueLong");
jmethodID constructor = env->GetMethodID(cls, "<init>", "(J)V");
jobject object = env->NewObject(cls, constructor, value);
env->DeleteLocalRef(cls);
}
jobject newTVMValueDouble(JNIEnv *env, jdouble value) {
- jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueDouble");
+ jclass cls = env->FindClass("org/apache/tvm/TVMValueDouble");
jmethodID constructor = env->GetMethodID(cls, "<init>", "(D)V");
jobject object = env->NewObject(cls, constructor, value);
env->DeleteLocalRef(cls);
jobject newTVMValueString(JNIEnv *env, const char *value) {
jstring jvalue = env->NewStringUTF(value);
- jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueString");
+ jclass cls = env->FindClass("org/apache/tvm/TVMValueString");
jmethodID constructor = env->GetMethodID(cls, "<init>", "(Ljava/lang/String;)V");
jobject object = env->NewObject(cls, constructor, jvalue);
env->DeleteLocalRef(cls);
jbyteArray jarr = env->NewByteArray(arr->size);
env->SetByteArrayRegion(jarr, 0, arr->size,
reinterpret_cast<jbyte *>(const_cast<char *>(arr->data)));
- jclass cls = env->FindClass("ml/dmlc/tvm/TVMValueBytes");
+ jclass cls = env->FindClass("org/apache/tvm/TVMValueBytes");
jmethodID constructor = env->GetMethodID(cls, "<init>", "([B)V");
jobject object = env->NewObject(cls, constructor, jarr);
env->DeleteLocalRef(cls);
}
jobject newModule(JNIEnv *env, jlong value) {
- jclass cls = env->FindClass("ml/dmlc/tvm/Module");
+ jclass cls = env->FindClass("org/apache/tvm/Module");
jmethodID constructor = env->GetMethodID(cls, "<init>", "(J)V");
jobject object = env->NewObject(cls, constructor, value);
env->DeleteLocalRef(cls);
}
jobject newFunction(JNIEnv *env, jlong value) {
- jclass cls = env->FindClass("ml/dmlc/tvm/Function");
+ jclass cls = env->FindClass("org/apache/tvm/Function");
jmethodID constructor = env->GetMethodID(cls, "<init>", "(J)V");
jobject object = env->NewObject(cls, constructor, value);
env->DeleteLocalRef(cls);
}
jobject newNDArray(JNIEnv *env, jlong handle, jboolean isview) {
- jclass cls = env->FindClass("ml/dmlc/tvm/NDArrayBase");
+ jclass cls = env->FindClass("org/apache/tvm/NDArrayBase");
jmethodID constructor = env->GetMethodID(cls, "<init>", "(JZ)V");
jobject object = env->NewObject(cls, constructor, handle, isview);
env->DeleteLocalRef(cls);
}
void fromJavaDType(JNIEnv *env, jobject jdtype, TVMType *dtype) {
- jclass tvmTypeClass = env->FindClass("ml/dmlc/tvm/TVMType");
+ jclass tvmTypeClass = env->FindClass("org/apache/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")));
}
void fromJavaContext(JNIEnv *env, jobject jctx, TVMContext *ctx) {
- jclass tvmContextClass = env->FindClass("ml/dmlc/tvm/TVMContext");
+ jclass tvmContextClass = env->FindClass("org/apache/tvm/TVMContext");
ctx->device_type = static_cast<DLDeviceType>(env->GetIntField(jctx,
env->GetFieldID(tvmContextClass, "deviceType", "I")));
ctx->device_id = static_cast<int>(env->GetIntField(jctx,
case kBytes:
return newTVMValueBytes(env, reinterpret_cast<TVMByteArray *>(value.v_handle));
case kNull:
- return newObject(env, "ml/dmlc/tvm/TVMValueNull");
+ return newObject(env, "org/apache/tvm/TVMValueNull");
default:
LOG(FATAL) << "Do NOT know how to handle return type code " << tcode;
}
* under the License.
*/
/*!
- * \file ml_dmlc_tvm_native_c_api.cc
+ * \file org_apache_tvm_native_c_api.cc
* \brief tvm4j jni source file
*/
-#include "ml_dmlc_tvm_native_c_api.h" // generated by javah
+#include "org_apache_tvm_native_c_api.h" // generated by javah
#ifdef TVM4J_ANDROID
#include "tvm_runtime.h"
#else
};
typedef dmlc::ThreadLocalStore<TVMFuncArgsThreadLocalEntry> TVMFuncArgsThreadLocalStore;
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_nativeLibInit
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_nativeLibInit
(JNIEnv *env, jobject obj, jstring jtvmLibFile) {
if (_tvmHandle == NULL && !env->IsSameObject(jtvmLibFile, NULL)) {
const char *tvmLibFile = env->GetStringUTFChars(jtvmLibFile, 0);
return env->GetJavaVM(&_jvm);
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_shutdown(JNIEnv *env, jobject obj) {
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_shutdown(JNIEnv *env, jobject obj) {
if (_tvmHandle) {
dlclose(_tvmHandle);
}
return 0;
}
-JNIEXPORT jstring JNICALL Java_ml_dmlc_tvm_LibInfo_tvmGetLastError(JNIEnv * env, jobject obj) {
+JNIEXPORT jstring JNICALL Java_org_apache_tvm_LibInfo_tvmGetLastError(JNIEnv * env, jobject obj) {
return env->NewStringUTF(TVMGetLastError());
}
// Function
-JNIEXPORT void JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncPushArgLong(
+JNIEXPORT void JNICALL Java_org_apache_tvm_LibInfo_tvmFuncPushArgLong(
JNIEnv *env, jobject obj, jlong arg) {
TVMValue value;
value.v_int64 = static_cast<int64_t>(arg);
e->tvmFuncArgTypes.push_back(kDLInt);
}
-JNIEXPORT void JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncPushArgDouble(
+JNIEXPORT void JNICALL Java_org_apache_tvm_LibInfo_tvmFuncPushArgDouble(
JNIEnv *env, jobject obj, jdouble arg) {
TVMValue value;
value.v_float64 = static_cast<double>(arg);
e->tvmFuncArgTypes.push_back(kDLFloat);
}
-JNIEXPORT void JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncPushArgString(
+JNIEXPORT void JNICALL Java_org_apache_tvm_LibInfo_tvmFuncPushArgString(
JNIEnv *env, jobject obj, jstring arg) {
TVMValue value;
jstring garg = reinterpret_cast<jstring>(env->NewGlobalRef(arg));
e->tvmFuncArgPushedStrs.push_back(std::make_pair(garg, value.v_str));
}
-JNIEXPORT void JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncPushArgHandle(
+JNIEXPORT void JNICALL Java_org_apache_tvm_LibInfo_tvmFuncPushArgHandle(
JNIEnv *env, jobject obj, jlong arg, jint argType) {
TVMValue value;
value.v_handle = reinterpret_cast<void *>(arg);
e->tvmFuncArgTypes.push_back(static_cast<int>(argType));
}
-JNIEXPORT void JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncPushArgBytes(
+JNIEXPORT void JNICALL Java_org_apache_tvm_LibInfo_tvmFuncPushArgBytes(
JNIEnv *env, jobject obj, jbyteArray arg) {
jbyteArray garg = reinterpret_cast<jbyteArray>(env->NewGlobalRef(arg));
jbyte *data = env->GetByteArrayElements(garg, 0);
// release (garg, data), byteArray later
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncListGlobalNames(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmFuncListGlobalNames(
JNIEnv *env, jobject obj, jobject jfuncNames) {
int outSize;
const char **outArray;
return ret;
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncFree(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmFuncFree(
JNIEnv *env, jobject obj, jlong jhandle) {
return TVMFuncFree(reinterpret_cast<TVMFunctionHandle>(jhandle));
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncGetGlobal(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmFuncGetGlobal(
JNIEnv *env, jobject obj, jstring jname, jobject jhandle) {
TVMFunctionHandle handle;
const char *name = env->GetStringUTFChars(jname, 0);
return ret;
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncCall(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmFuncCall(
JNIEnv *env, jobject obj, jlong jhandle, jobject jretVal) {
TVMFuncArgsThreadLocalEntry *e = TVMFuncArgsThreadLocalStore::Get();
int numArgs = e->tvmFuncArgValues.size();
}
// return TVMValue object to Java
- jclass refTVMValueCls = env->FindClass("ml/dmlc/tvm/Base$RefTVMValue");
+ jclass refTVMValueCls = env->FindClass("org/apache/tvm/Base$RefTVMValue");
jfieldID refTVMValueFid
- = env->GetFieldID(refTVMValueCls, "value", "Lml/dmlc/tvm/TVMValue;");
+ = env->GetFieldID(refTVMValueCls, "value", "Lorg/apache/tvm/TVMValue;");
env->SetObjectField(jretVal, refTVMValueFid, tvmRetValueToJava(env, retVal, retTypeCode));
CHECK(jniStatus == JNI_OK);
}
- jclass tvmValueCls = env->FindClass("ml/dmlc/tvm/TVMValue");
+ jclass tvmValueCls = env->FindClass("org/apache/tvm/TVMValue");
jobjectArray jargs = env->NewObjectArray(numArgs, tvmValueCls, 0);
for (int i = 0; i < numArgs; ++i) {
TVMValue arg = args[i];
env->SetObjectArrayElement(jargs, i, jarg);
}
- jclass clsFunc = env->FindClass("ml/dmlc/tvm/Function");
+ jclass clsFunc = env->FindClass("org/apache/tvm/Function");
jmethodID invokeRegisteredCbFunc = env->GetStaticMethodID(clsFunc, "invokeRegisteredCbFunc",
- "(Lml/dmlc/tvm/Function$Callback;[Lml/dmlc/tvm/TVMValue;)Ljava/lang/Object;");
+ "(Lorg/apache/tvm/Function$Callback;[Lorg/apache/tvm/TVMValue;)Ljava/lang/Object;");
jmethodID pushArgToStack = env->GetStaticMethodID(clsFunc, "pushArgToStack",
"(Ljava/lang/Object;)V");
env->DeleteGlobalRef(reinterpret_cast<jobject>(resourceHandle));
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncCreateFromCFunc(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmFuncCreateFromCFunc(
JNIEnv *env, jobject obj, jobject jfunction, jobject jretHandle) {
TVMFunctionHandle out;
int ret = TVMFuncCreateFromCFunc(reinterpret_cast<TVMPackedCFunc>(&funcInvokeCallback),
return ret;
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmFuncRegisterGlobal(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmFuncRegisterGlobal(
JNIEnv *env, jobject obj, jstring jname, jlong jhandle, jint joverride) {
const char *name = env->GetStringUTFChars(jname, 0);
int ret = TVMFuncRegisterGlobal(
}
// Module
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmModFree(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmModFree(
JNIEnv *env, jobject obj, jlong jhandle) {
return TVMModFree(reinterpret_cast<TVMModuleHandle>(jhandle));
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmModImport(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmModImport(
JNIEnv *env, jobject obj, jlong jmod, jlong jdep) {
return TVMModImport(reinterpret_cast<TVMModuleHandle>(jmod),
reinterpret_cast<TVMModuleHandle>(jdep));
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmModGetFunction(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmModGetFunction(
JNIEnv *env, jobject obj, jlong jhandle, jstring jname, jint jimport, jobject jret) {
TVMFunctionHandle retFunc;
}
// NDArray
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmArrayFree(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmArrayFree(
JNIEnv *env, jobject obj, jlong jhandle) {
return TVMArrayFree(reinterpret_cast<TVMArrayHandle>(jhandle));
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmArrayAlloc(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmArrayAlloc(
JNIEnv *env, jobject obj, jlongArray jshape, jint jdtypeCode,
jint jdtypeBits, jint jdtypeLanes, jint jdeviceType, jint jdeviceId, jobject jret) {
int ndim = static_cast<int>(env->GetArrayLength(jshape));
return ret;
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmArrayGetShape(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmArrayGetShape(
JNIEnv *env, jobject obj, jlong jhandle, jobject jshape) {
TVMArray *array = reinterpret_cast<TVMArray *>(jhandle);
int64_t *shape = array->shape;
return 0;
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmArrayCopyFromTo(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmArrayCopyFromTo(
JNIEnv *env, jobject obj, jlong jfrom, jlong jto) {
return TVMArrayCopyFromTo(reinterpret_cast<TVMArrayHandle>(jfrom),
reinterpret_cast<TVMArrayHandle>(jto), NULL);
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmArrayCopyFromJArray(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmArrayCopyFromJArray(
JNIEnv *env, jobject obj, jbyteArray jarr, jlong jfrom, jlong jto) {
jbyte *data = env->GetByteArrayElements(jarr, NULL);
return ret;
}
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmArrayCopyToJArray(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmArrayCopyToJArray(
JNIEnv *env, jobject obj, jlong jfrom, jbyteArray jarr) {
TVMArray *from = reinterpret_cast<TVMArray *>(jfrom);
int size = static_cast<int>(env->GetArrayLength(jarr));
}
// Context
-JNIEXPORT jint JNICALL Java_ml_dmlc_tvm_LibInfo_tvmSynchronize(
+JNIEXPORT jint JNICALL Java_org_apache_tvm_LibInfo_tvmSynchronize(
JNIEnv *env, jint deviceType, jint deviceId) {
return TVMSynchronize(static_cast<int>(deviceType), static_cast<int>(deviceId), NULL);
}
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
- <groupId>ml.dmlc.tvm</groupId>
+ <groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>TVM4J Package - Parent</name>