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
ec9f38ec
Commit
ec9f38ec
authored
Jan 31, 2018
by
Tianqi Chen
Committed by
GitHub
Jan 31, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[TOPI] Fix cpp library dependency on MAC (#852)
parent
6d3a3adf
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
17 additions
and
23 deletions
+17
-23
Makefile
+13
-16
python/tvm/_ffi/libinfo.py
+2
-4
topi/include/topi/detail/extern.h
+2
-2
topi/tests/python_cpp/test_topi_clip.py
+0
-1
No files found.
Makefile
View file @
ec9f38ec
...
...
@@ -27,6 +27,7 @@ LLVM_CFLAGS= -fno-rtti -DDMLC_ENABLE_RTTI=0 -DDMLC_USE_FOPEN64=0
LDFLAGS
=
-pthread
-lm
-ldl
INCLUDE_FLAGS
=
-Iinclude
-I
$(DLPACK_PATH)
/include
-I
$(DMLC_CORE_PATH)
/include
-IHalideIR
/src
-Itopi
/include
CFLAGS
=
-std
=
c++11
-Wall
-O2
$(INCLUDE_FLAGS)
-fPIC
PKG_LDFLAGS
=
FRAMEWORKS
=
OBJCFLAGS
=
-fno-objc-arc
EMCC_FLAGS
=
-std
=
c++11
-DDMLC_LOG_STACK_TRACE
=
0
\
...
...
@@ -80,6 +81,10 @@ ALL_DEP = $(CC_OBJ) $(CONTRIB_OBJ) $(LIB_HALIDEIR)
RUNTIME_DEP
=
$(RUNTIME_OBJ)
TOPI_DEP
=
$(TOPI_OBJ)
ifeq
($(UNAME_S),
Darwin)
PKG_LDFLAGS
+=
-undefined
dynamic_lookup
endif
# Dependency specific rules
ifdef
CUDA_PATH
NVCC
=
$(CUDA_PATH)
/bin/nvcc
...
...
@@ -201,7 +206,10 @@ else
JVM_PKG_PROFILE
:=
$(JVM_PKG_PROFILE)
-cpu
endif
BUILD_TARGETS
?=
lib/libtvm.
$(SHARED_LIBRARY_SUFFIX)
lib/libtvm_runtime.
$(SHARED_LIBRARY_SUFFIX)
lib/libtvm_topi.
$(SHARED_LIBRARY_SUFFIX)
BUILD_TARGETS
?=
lib/libtvm.
$(SHARED_LIBRARY_SUFFIX)
\
lib/libtvm_runtime.
$(SHARED_LIBRARY_SUFFIX)
\
lib/libtvm_topi.
$(SHARED_LIBRARY_SUFFIX)
all
:
${BUILD_TARGETS}
runtime
:
lib/libtvm_runtime.$(SHARED_LIBRARY_SUFFIX)
web
:
lib/libtvm_web_runtime.js lib/libtvm_web_runtime.bc
...
...
@@ -235,29 +243,18 @@ build/src/%.o: topi/src/%.cc
$(CXX)
$(CFLAGS)
-MM
-MT
build/src/
$*
.o
$<
>
build/src/
$*
.d
$(CXX)
-c
$(CFLAGS)
-c
$<
-o
$@
lib/libtvm.
dylib
:
$(ALL_DEP) $(RUNTIME_DEP)
lib/libtvm.
${SHARED_LIBRARY_SUFFIX}
:
$(ALL_DEP) $(RUNTIME_DEP)
@
mkdir
-p
$
(
@D
)
$(CXX)
$(CFLAGS)
$(FRAMEWORKS)
-shared
-o
$@
$
(
filter %.o %.a,
$^
)
$(LDFLAGS)
lib/libtvm_topi.dylib
:
lib/libtvm.so $(TOPI_DEP)
@
mkdir
-p
$
(
@D
)
$(CXX)
$(CFLAGS)
$(FRAMEWORKS)
-L
./lib
-ltvm
-shared
-o
$@
$
(
filter %.o %.a,
$^
)
$(LDFLAGS)
lib/libtvm_runtime.dylib
:
$(RUNTIME_DEP)
lib/libtvm_topi.${SHARED_LIBRARY_SUFFIX}
:
$(TOPI_DEP)
@
mkdir
-p
$
(
@D
)
$(CXX)
$(CFLAGS)
$(FRAMEWORKS)
-shared
-o
$@
$
(
filter %.o %.a,
$^
)
$(LDFLAGS)
$(CXX)
$(CFLAGS)
$(FRAMEWORKS)
-shared
-o
$@
$
(
filter %.o %.a,
$^
)
$(LDFLAGS)
$(PKG_LDFLAGS)
lib/libtvm
.so
:
$(ALL_DEP)
$(RUNTIME_DEP)
lib/libtvm
_runtime.${SHARED_LIBRARY_SUFFIX}
:
$(RUNTIME_DEP)
@
mkdir
-p
$
(
@D
)
$(CXX)
$(CFLAGS)
$(FRAMEWORKS)
-shared
-o
$@
$
(
filter %.o %.a,
$^
)
$(LDFLAGS)
lib/libtvm_topi.so
:
lib/libtvm.so $(TOPI_DEP)
@
mkdir
-p
$
(
@D
)
$(CXX)
$(CFLAGS)
$(FRAMEWORKS)
-L
./lib
-ltvm
-shared
-o
$@
$
(
filter %.o %.a,
$^
)
$(LDFLAGS)
lib/libtvm_runtime.so
:
$(RUNTIME_DEP)
@
mkdir
-p
$
(
@D
)
$(CXX)
$(CFLAGS)
$(FRAMEWORKS)
-shared
-o
$@
$
(
filter %.o %.a,
$^
)
$(LDFLAGS)
lib/libtvm_web_runtime.bc
:
web/web_runtime.cc
@
mkdir
-p
build/web
...
...
python/tvm/_ffi/libinfo.py
View file @
ec9f38ec
...
...
@@ -2,7 +2,7 @@
from
__future__
import
absolute_import
import
sys
import
os
import
warnings
def
find_lib_path
(
name
=
None
,
search_path
=
None
,
optional
=
False
):
"""Find dynamic library files.
...
...
@@ -91,9 +91,7 @@ def find_lib_path(name=None, search_path=None, optional=False):
str
(
'
\n
'
.
join
(
lib_dll_path
+
runtime_dll_path
)))
if
not
optional
:
raise
RuntimeError
(
message
)
else
:
warnings
.
warn
(
message
)
return
None
return
None
if
use_runtime
:
sys
.
stderr
.
write
(
"Loading runtime library
%
s... exec only
\n
"
%
lib_found
[
0
])
...
...
topi/include/topi/detail/extern.h
View file @
ec9f38ec
...
...
@@ -110,7 +110,7 @@ Expr pack_buffer(Buffer buf) {
buf
->
data
,
shape
,
strides
,
make_const
(
Int
(
32
),
buf
->
shape
.
size
(
)),
make_const
(
Int
(
32
),
static_cast
<
int64_t
>
(
buf
->
shape
.
size
()
)),
make_const
(
buf
->
dtype
,
0
),
buf
->
elem_offset
};
...
...
@@ -125,7 +125,7 @@ Expr pack_buffer(Buffer buf) {
* by the arguments to pass to the PackedFunc when called. The first element of the
* array must be a constant string expression.
*
* \return An expression representing the invocation
* \return An expression representing the invocation
*/
Expr
call_packed
(
Array
<
Expr
>
args
)
{
return
tvm
::
ir
::
Call
::
make
(
Int
(
32
),
tvm
::
ir
::
intrinsic
::
tvm_call_packed
,
...
...
topi/tests/python_cpp/test_topi_clip.py
View file @
ec9f38ec
...
...
@@ -4,7 +4,6 @@ import tvm
import
topi
from
topi.util
import
get_const_tuple
from
tvm.contrib.pickle_memoize
import
memoize
from
util
import
make_vector
def
verify_clip
(
N
,
a_min
,
a_max
,
dtype
):
...
...
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