Commit 1dcf8a16 by Yizhi Liu Committed by Tianqi Chen

Rename ml.dmlc.tvm to org.apache.tvm (#4290)

parent d64bf6b5
......@@ -21,7 +21,7 @@ This folder contains Android Demo app that allows us to show how to deploy model
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
......@@ -45,7 +45,7 @@ dependencies {
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'
}
```
......@@ -124,7 +124,7 @@ If everything goes well, you will find compile tools in `/opt/android-toolchain-
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`
```
......
......@@ -38,7 +38,7 @@ android {
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
......@@ -68,6 +68,6 @@ dependencies {
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'
}
......@@ -20,7 +20,7 @@ under the License.
-->
<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"/>
......@@ -32,7 +32,7 @@ under the License.
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">
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.android.demo;
package org.apache.tvm.android.demo;
import android.Manifest;
import android.content.Intent;
......@@ -53,12 +53,12 @@ import java.text.SimpleDateFormat;
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();
......
......@@ -16,7 +16,7 @@ endif
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 \
......
......@@ -18,8 +18,8 @@
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
......@@ -25,7 +25,7 @@ under the License.
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"
......
# 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
......@@ -39,7 +39,7 @@ dependencies {
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'
}
```
......@@ -64,12 +64,12 @@ If you see error:
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
......
......@@ -29,7 +29,7 @@ android {
compileSdkVersion 26
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "ml.dmlc.tvm.tvmrpc"
applicationId "org.apache.tvm.tvmrpc"
minSdkVersion 24
targetSdkVersion 26
versionCode 1
......@@ -58,6 +58,6 @@ dependencies {
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'
}
......@@ -20,7 +20,7 @@ under the License.
-->
<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" />
......
......@@ -15,27 +15,21 @@
* 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 {
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.tvmrpc;
package org.apache.tvm.tvmrpc;
import android.os.Bundle;
import android.support.v7.app.AppCompatActivity;
......
......@@ -15,12 +15,12 @@
* 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.
......
......@@ -16,7 +16,7 @@ endif
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 \
......
......@@ -18,8 +18,8 @@
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
......@@ -25,7 +25,7 @@ under the License.
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"
......
......@@ -25,7 +25,7 @@ under the License.
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"
......
......@@ -18,7 +18,7 @@ import argparse
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')
......
......@@ -391,7 +391,7 @@
);
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;
......@@ -411,7 +411,7 @@
);
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;
......@@ -428,7 +428,7 @@
);
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";
};
......@@ -446,7 +446,7 @@
);
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";
};
......
......@@ -39,4 +39,4 @@ deploy_lib.so, deploy_graph.json, deploy_param.params will go to android target.
## 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.
......@@ -122,9 +122,9 @@ if __name__ == "__main__":
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;
......@@ -175,4 +175,4 @@ Server server = new Server(proxyHost, proxyPort, "key");
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
......@@ -24,13 +24,13 @@ under the License.
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>
......@@ -38,12 +38,12 @@ under the License.
<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>
......
......@@ -48,7 +48,7 @@ under the License.
<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>
......
......@@ -24,13 +24,13 @@ under the License.
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>
......@@ -38,12 +38,12 @@ under the License.
<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>
......
......@@ -48,7 +48,7 @@ under the License.
<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>
......
......@@ -24,13 +24,13 @@ under the License.
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>
......
......@@ -24,13 +24,13 @@ under the License.
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>
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import java.util.HashMap;
import java.util.Map;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
/**
* Internal api functions.
......
......@@ -15,9 +15,9 @@
* 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;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import java.util.ArrayList;
import java.util.Collections;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import java.util.List;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import java.util.HashMap;
import java.util.Map;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
/**
* Base class of NDArray. To handle callback array.
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import java.io.File;
import java.io.FileInputStream;
......
......@@ -15,9 +15,9 @@
* 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;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
public class TVMType {
public static final int INT = 0;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
public class TVMValue {
public final TypeCode typeCode;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
public class TVMValueBytes extends TVMValue {
public final byte[] value;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
public class TVMValueDouble extends TVMValue {
public final double value;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
/**
* Java class related to TVM handles (TypeCode.HANDLE)
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
public class TVMValueLong extends TVMValue {
public final long value;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
public class TVMValueNull extends TVMValue {
public TVMValueNull() {
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
public class TVMValueString extends TVMValue {
public final String value;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
// Type code used in API calls
public enum TypeCode {
......
......@@ -17,12 +17,12 @@
* 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.
......
......@@ -15,15 +15,15 @@
* 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;
......
......@@ -15,10 +15,10 @@
* 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 {
/**
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.rpc;
package org.apache.tvm.rpc;
import java.io.InputStream;
import java.io.OutputStream;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.rpc;
package org.apache.tvm.rpc;
import java.io.IOException;
import java.io.InputStream;
......
......@@ -15,11 +15,11 @@
* 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;
......
......@@ -15,9 +15,9 @@
* 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;
......
......@@ -15,11 +15,11 @@
* 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;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.rpc;
package org.apache.tvm.rpc;
/**
* Watchdog for RPC.
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.rpc;
package org.apache.tvm.rpc;
import java.io.IOException;
......
......@@ -15,7 +15,7 @@
* 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;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.rpc;
package org.apache.tvm.rpc;
import java.io.IOException;
import java.io.InputStream;
......
......@@ -15,9 +15,9 @@
* 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 {
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm.rpc;
package org.apache.tvm.rpc;
import java.io.IOException;
import java.io.InputStream;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import org.junit.Test;
......
......@@ -15,7 +15,7 @@
* limitations under the License.
*/
package ml.dmlc.tvm;
package org.apache.tvm;
import org.junit.BeforeClass;
import org.junit.Test;
......
......@@ -15,7 +15,7 @@
* 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
......@@ -20,7 +20,7 @@ package ml.dmlc.tvm;
*/
import ml.dmlc.tvm.rpc.Server;
import org.apache.tvm.rpc.Server;
import java.io.IOException;
......
......@@ -15,15 +15,15 @@
* 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;
......
......@@ -15,12 +15,12 @@
* 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;
......
......@@ -24,7 +24,7 @@ under the License.
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>
......@@ -39,7 +39,7 @@ under the License.
<dependencies>
<dependency>
<groupId>ml.dmlc.tvm</groupId>
<groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
......@@ -68,7 +68,7 @@ under the License.
<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>
......@@ -96,9 +96,9 @@ under the License.
<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>
......
......@@ -24,7 +24,7 @@ under the License.
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>
......@@ -39,7 +39,7 @@ under the License.
<dependencies>
<dependency>
<groupId>ml.dmlc.tvm</groupId>
<groupId>org.apache.tvm</groupId>
<artifactId>tvm4j-core</artifactId>
<version>${project.version}</version>
<type>jar</type>
......@@ -68,7 +68,7 @@ under the License.
<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>
......@@ -102,9 +102,9 @@ under the License.
<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>
......
......@@ -24,7 +24,7 @@ under the License.
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>
......
......@@ -27,7 +27,7 @@
// 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);
......@@ -35,7 +35,7 @@ jlong getLongField(JNIEnv *env, jobject obj) {
}
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);
......@@ -43,21 +43,21 @@ jint getIntField(JNIEnv *env, jobject obj) {
}
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);
......@@ -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/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);
......@@ -74,7 +74,7 @@ jlong getTVMValueLongField(JNIEnv *env, jobject obj,
}
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);
......@@ -82,7 +82,7 @@ jdouble getTVMValueDoubleField(JNIEnv *env, jobject obj) {
}
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);
......@@ -90,7 +90,7 @@ jstring getTVMValueStringField(JNIEnv *env, jobject obj) {
}
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);
......@@ -98,7 +98,7 @@ jobject newTVMValueHandle(JNIEnv *env, jlong value) {
}
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);
......@@ -106,7 +106,7 @@ jobject newTVMValueLong(JNIEnv *env, jlong value) {
}
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);
......@@ -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/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);
......@@ -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<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);
......@@ -136,7 +136,7 @@ jobject newTVMValueBytes(JNIEnv *env, const TVMByteArray *arr) {
}
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);
......@@ -144,7 +144,7 @@ jobject newModule(JNIEnv *env, jlong value) {
}
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);
......@@ -152,7 +152,7 @@ jobject newFunction(JNIEnv *env, jlong value) {
}
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);
......@@ -168,7 +168,7 @@ jobject newObject(JNIEnv *env, const char *clsname) {
}
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")));
......@@ -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/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,
......@@ -206,7 +206,7 @@ jobject tvmRetValueToJava(JNIEnv *env, TVMValue value, int tcode) {
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;
}
......
......@@ -3,7 +3,7 @@
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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment