Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
MindSpore
akg
提交
9890c29b
A
akg
项目概览
MindSpore
/
akg
通知
58
Star
7
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
A
akg
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
9890c29b
编写于
7月 16, 2020
作者:
L
looop5
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
add macro in CMakeLists.txt to differ backend d and gpu, add modification statement
上级
1f184177
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
55 addition
and
29 deletion
+55
-29
CMakeLists.txt
CMakeLists.txt
+3
-0
third_party/incubator-tvm/src/pass/split_host_device.cc
third_party/incubator-tvm/src/pass/split_host_device.cc
+20
-21
third_party/patch/incubator-tvm/incubator-tvm.patch
third_party/patch/incubator-tvm/incubator-tvm.patch
+32
-8
未找到文件。
CMakeLists.txt
浏览文件 @
9890c29b
...
...
@@ -98,6 +98,9 @@ add_definitions(-DDMLC_LOG_CUSTOMIZE=1)
if
(
USE_AKG_LOG
)
add_definitions
(
-DUSE_AKG_LOG=1
)
endif
()
if
(
NOT USE_CUDA
)
add_definitions
(
"-DBACKEND_D"
)
endif
()
# Generic compilation options
include
(
CheckCXXCompilerFlag
)
...
...
third_party/incubator-tvm/src/pass/split_host_device.cc
浏览文件 @
9890c29b
...
...
@@ -234,33 +234,32 @@ class HostDeviceSplitter : public IRMutator {
}
}
const
char
*
mode
=
getenv
(
"RUNTIME_MODE"
);
if
(
mode
)
{
std
::
shared_ptr
<
LoweredFuncNode
>
na
=
std
::
make_shared
<
LoweredFuncNode
>
();
for
(
unsigned
i
=
0
;
i
<
(
unsigned
)
args_real
.
size
();
i
++
)
{
bool
match
=
false
;
for
(
unsigned
j
=
0
;
j
<
(
unsigned
)
n
->
args
.
size
();
j
++
)
{
if
(
strcmp
(
args_real
[
i
].
get
()
->
name_hint
.
c_str
(),
n
->
args
[
j
].
get
()
->
name_hint
.
c_str
())
==
0
)
{
na
->
args
.
push_back
(
n
->
args
[
j
]);
match
=
true
;
break
;
}
else
{
continue
;
}
#ifdef BACKEND_D
std
::
shared_ptr
<
LoweredFuncNode
>
na
=
std
::
make_shared
<
LoweredFuncNode
>
();
for
(
unsigned
i
=
0
;
i
<
(
unsigned
)
args_real
.
size
();
i
++
)
{
bool
match
=
false
;
for
(
unsigned
j
=
0
;
j
<
(
unsigned
)
n
->
args
.
size
();
j
++
)
{
if
(
strcmp
(
args_real
[
i
].
get
()
->
name_hint
.
c_str
(),
n
->
args
[
j
].
get
()
->
name_hint
.
c_str
())
==
0
)
{
na
->
args
.
push_back
(
n
->
args
[
j
]);
match
=
true
;
break
;
}
else
{
continue
;
}
}
if
(
!
match
)
{
na
->
args
.
push_back
(
args_real
[
i
]);
// mark handle data type.
for
(
auto
kv
:
handle_data_type_
)
{
if
(
strcmp
(
args_real
[
i
].
get
()
->
name_hint
.
c_str
(),
kv
.
first
->
name_hint
.
c_str
())
==
0
)
{
n
->
handle_data_type
.
Set
(
args_real
[
i
],
kv
.
second
);
}
if
(
!
match
)
{
na
->
args
.
push_back
(
args_real
[
i
]);
// mark handle data type.
for
(
auto
kv
:
handle_data_type_
)
{
if
(
strcmp
(
args_real
[
i
].
get
()
->
name_hint
.
c_str
(),
kv
.
first
->
name_hint
.
c_str
())
==
0
)
{
n
->
handle_data_type
.
Set
(
args_real
[
i
],
kv
.
second
);
}
}
}
n
->
args
=
na
->
args
;
}
n
->
args
=
na
->
args
;
#endif
LoweredFunc
f_device
(
n
);
Array
<
Expr
>
call_args
;
...
...
third_party/patch/incubator-tvm/incubator-tvm.patch
浏览文件 @
9890c29b
diff -uprN tvm_orig/python/tvm/_ffi/base.py tvm/python/tvm/_ffi/base.py
--- tvm_orig/python/tvm/_ffi/base.py 2020-04-13 20:18:09.519984547 +0800
+++ tvm/python/tvm/_ffi/base.py 2020-04-13 20:14:21.510253128 +0800
@@ -48,7 +48,18 @@
else:
diff -Npur tvm_orig/python/tvm/_ffi/base.py tvm/python/tvm/_ffi/base.py
--- tvm_orig/python/tvm/_ffi/base.py 2020-07-16 14:39:28.859033775 +0800
+++ tvm/python/tvm/_ffi/base.py 2020-07-16 14:42:26.594223690 +0800
@@ -16,6 +16,11 @@
# under the License.
# coding: utf-8
# pylint: disable=invalid-name
+
+#
+# 2020.7.16 - Modify _load_lib function to find the correct library.
+#
+
"""Base library for TVM FFI."""
from __future__ import absolute_import
@@ -48,7 +53,18 @@ else:
def _load_lib():
"""Load libary by searching possible path."""
...
...
@@ -21,10 +33,22 @@ diff -uprN tvm_orig/python/tvm/_ffi/base.py tvm/python/tvm/_ffi/base.py
lib = ctypes.CDLL(lib_path[0], ctypes.RTLD_GLOBAL)
# DMatrix functions
lib.TVMGetLastError.restype = ctypes.c_char_p
diff -uprN tvm_orig/topi/python/topi/cpp/impl.py tvm/topi/python/topi/cpp/impl.py
--- tvm_orig/topi/python/topi/cpp/impl.py 2020-04-13 20:18:09.535984509 +0800
+++ tvm/topi/python/topi/cpp/impl.py 2020-04-13 20:16:41.784427200 +0800
@@ -31,11 +31,18 @@
def _get_lib_names():
diff -Npur tvm_orig/topi/python/topi/cpp/impl.py tvm/topi/python/topi/cpp/impl.py
--- tvm_orig/topi/python/topi/cpp/impl.py 2020-07-16 14:40:07.754722324 +0800
+++ tvm/topi/python/topi/cpp/impl.py 2020-07-16 14:42:56.638225874 +0800
@@ -14,6 +14,11 @@
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
+
+#
+# 2020.7.16 - Modify _load_lib function to find the correct library.
+#
+
"""Load Lib for C++ TOPI ops and schedules"""
import sys
import os
@@ -31,11 +36,18 @@
def _get_lib_names():
def _load_lib():
"""Load libary by searching possible path."""
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录