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
7250005d
Commit
7250005d
authored
Jan 11, 2017
by
Haichen Shen
Committed by
Tianqi Chen
Jan 11, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix ctypes bug for mac (#9)
* fix c_api bug for mac * update travis
parent
39314014
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
9 additions
and
7 deletions
+9
-7
.travis.yml
+1
-1
python/tvm/_ctypes/_api.py
+8
-6
No files found.
.travis.yml
View file @
7250005d
...
@@ -4,7 +4,7 @@ language: cpp
...
@@ -4,7 +4,7 @@ language: cpp
os
:
os
:
-
linux
-
linux
#
- osx
-
osx
env
:
env
:
# code analysis
# code analysis
...
...
python/tvm/_ctypes/_api.py
View file @
7250005d
...
@@ -25,8 +25,13 @@ kDouble = 2
...
@@ -25,8 +25,13 @@ kDouble = 2
kStr
=
3
kStr
=
3
kNodeHandle
=
4
kNodeHandle
=
4
NODE_TYPE
=
{
}
def
_type_key
(
handle
):
def
_return_node
(
x
):
handle
=
x
.
v_handle
if
not
isinstance
(
handle
,
ctypes
.
c_void_p
):
handle
=
ctypes
.
c_void_p
(
handle
)
ret_val
=
ArgVariant
()
ret_val
=
ArgVariant
()
ret_typeid
=
ctypes
.
c_int
()
ret_typeid
=
ctypes
.
c_int
()
ret_success
=
ctypes
.
c_int
()
ret_success
=
ctypes
.
c_int
()
...
@@ -35,17 +40,14 @@ def _type_key(handle):
...
@@ -35,17 +40,14 @@ def _type_key(handle):
ctypes
.
byref
(
ret_val
),
ctypes
.
byref
(
ret_val
),
ctypes
.
byref
(
ret_typeid
),
ctypes
.
byref
(
ret_typeid
),
ctypes
.
byref
(
ret_success
)))
ctypes
.
byref
(
ret_success
)))
return
py_str
(
ret_val
.
v_str
)
return
NODE_TYPE
.
get
(
py_str
(
ret_val
.
v_str
),
NodeBase
)(
handle
)
NODE_TYPE
=
{
}
RET_SWITCH
=
{
RET_SWITCH
=
{
kNull
:
lambda
x
:
None
,
kNull
:
lambda
x
:
None
,
kLong
:
lambda
x
:
x
.
v_long
,
kLong
:
lambda
x
:
x
.
v_long
,
kDouble
:
lambda
x
:
x
.
v_double
,
kDouble
:
lambda
x
:
x
.
v_double
,
kStr
:
lambda
x
:
py_str
(
x
.
v_str
),
kStr
:
lambda
x
:
py_str
(
x
.
v_str
),
kNodeHandle
:
lambda
x
:
NODE_TYPE
.
get
(
_type_key
(
x
),
NodeBase
)(
x
.
v_handle
)
kNodeHandle
:
lambda
x
:
_return_node
(
x
)
}
}
class
SliceBase
(
object
):
class
SliceBase
(
object
):
...
...
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