Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
T
tic
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wenyuanbo
tic
Commits
a59774e3
Commit
a59774e3
authored
Aug 14, 2017
by
Tianqi Chen
Committed by
GitHub
Aug 14, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[BUILD] Simplify build process (#326)
parent
cbdd14f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
15 deletions
+16
-15
python/tvm/build_module.py
+16
-15
No files found.
python/tvm/build_module.py
View file @
a59774e3
...
...
@@ -4,6 +4,8 @@ This module provides the functions to transform schedule to
LoweredFunc and compiled Module.
"""
from
__future__
import
absolute_import
as
_abs
import
warnings
from
.
import
api
from
.
import
tensor
from
.
import
schedule
...
...
@@ -324,29 +326,28 @@ def build(sch,
raise
ValueError
(
"unknown function type
%
d"
%
func
.
func_type
)
if
not
target
.
startswith
(
"llvm"
)
and
target
!=
"stackvm"
and
not
fdevice
:
raise
ValueError
(
warnings
.
warn
(
"Specified target
%
s, but cannot find device code, did you do bind?"
%
target
)
device
=
"cpu"
if
target
.
startswith
(
"llvm"
)
or
target
==
"stackvm"
else
target
device_type
=
ndarray
.
context
(
device
,
0
)
.
device_type
fhost
=
[
ir_pass
.
BindDeviceType
(
x
,
device_type
)
for
x
in
fhost
]
fhost
=
[
ir_pass
.
LowerTVMBuiltin
(
x
)
for
x
in
fhost
]
if
not
target_host
and
fdevice
:
target_host
=
"llvm"
if
module
.
enabled
(
"llvm"
)
else
"stackvm"
if
fdevice
:
fdevice
=
[
ir_pass
.
LowerIntrin
(
x
,
target
)
for
x
in
fdevice
]
fhost
=
[
ir_pass
.
LowerIntrin
(
x
,
target_host
)
for
x
in
fhost
]
else
:
fhost
=
[
ir_pass
.
LowerIntrin
(
x
,
target
)
for
x
in
fhost
]
if
not
target_host
:
if
device
==
"cpu"
:
target_host
=
target
assert
not
fdevice
else
:
target_host
=
"llvm"
if
module
.
enabled
(
"llvm"
)
else
"stackvm"
target_device
=
target
fdevice
=
[
ir_pass
.
LowerIntrin
(
x
,
target_device
)
for
x
in
fdevice
]
fhost
=
[
ir_pass
.
LowerIntrin
(
x
,
target_host
)
for
x
in
fhost
]
fhost
=
[
ir_pass
.
CombineContextCall
(
x
)
for
x
in
fhost
]
mhost
=
codegen
.
build_module
(
fhost
,
target_host
)
if
fdevice
:
mhost
=
codegen
.
build_module
(
fhost
,
target_host
)
if
target
:
mdev
=
codegen
.
build_module
(
fdevice
,
target
)
mhost
.
import_module
(
mdev
)
return
mhost
else
:
return
codegen
.
build_module
(
fhost
,
target
)
mdev
=
codegen
.
build_module
(
fdevice
,
target_device
)
mhost
.
import_module
(
mdev
)
return
mhost
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment