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
7391fc00
Commit
7391fc00
authored
Aug 29, 2019
by
Alexander Pivovarov
Committed by
Lianmin Zheng
Aug 29, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add build_create_shared_func to tvm/contrib/cc.py (#3840)
parent
739fd248
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
1 deletions
+24
-1
python/tvm/contrib/cc.py
+24
-1
No files found.
python/tvm/contrib/cc.py
View file @
7391fc00
...
...
@@ -55,6 +55,29 @@ def create_shared(output,
# assign so as default output format
create_shared
.
output_format
=
"so"
if
sys
.
platform
!=
"win32"
else
"dll"
def
build_create_shared_func
(
options
=
None
,
compile_cmd
=
"g++"
):
"""Build create_shared function with particular default options and compile_cmd.
Parameters
----------
options : List[str]
The list of additional options string.
compile_cmd : Optional[str]
The compiler command.
Returns
-------
create_shared_wrapper : Callable[[str, str, Optional[str]], None]
A compilation function that can be passed to export_library or to autotvm.LocalBuilder.
"""
def
create_shared_wrapper
(
output
,
objects
,
options
=
options
,
compile_cmd
=
compile_cmd
):
create_shared
(
output
,
objects
,
options
,
compile_cmd
)
create_shared_wrapper
.
output_format
=
create_shared
.
output_format
return
create_shared_wrapper
def
cross_compiler
(
compile_func
,
base_options
=
None
,
output_format
=
"so"
):
"""Create a cross compiler function.
...
...
@@ -63,7 +86,7 @@ def cross_compiler(compile_func, base_options=None, output_format="so"):
compile_func : Callable[[str, str, Optional[str]], None]
Function that performs the actual compilation
options : Optional[List[str]]
base_
options : Optional[List[str]]
List of additional optional string.
output_format : Optional[str]
...
...
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