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
7d2654c2
Commit
7d2654c2
authored
Feb 04, 2018
by
Tianqi Chen
Committed by
GitHub
Feb 04, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CODEGEN] Fix vector element access in metal (#872)
parent
b5bd923a
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
29 additions
and
2 deletions
+29
-2
apps/ios_rpc/tests/ios_rpc_test.py
+1
-0
python/tvm/contrib/xcode.py
+7
-1
python/tvm/target.py
+1
-1
src/codegen/codegen_metal.cc
+14
-0
src/codegen/codegen_metal.h
+6
-0
No files found.
apps/ios_rpc/tests/ios_rpc_test.py
View file @
7d2654c2
...
...
@@ -59,6 +59,7 @@ def test_rpc_module():
# Start RPC test server that contains the compiled library.
server
=
xcode
.
popen_test_rpc
(
proxy_host
,
proxy_port
,
key
,
destination
=
destination
,
options
=
[
'-quiet'
],
libs
=
[
path_dso1
,
path_dso2
])
# connect to the proxy
...
...
python/tvm/contrib/xcode.py
View file @
7d2654c2
...
...
@@ -201,5 +201,11 @@ def popen_test_rpc(host,
if
options
:
cmd
+=
options
cmd
+=
[
"test"
]
proc
=
subprocess
.
Popen
(
cmd
)
if
"-quiet"
in
options
:
with
open
(
os
.
devnull
,
'w'
)
as
devnull
:
proc
=
subprocess
.
Popen
(
cmd
,
stderr
=
subprocess
.
STDOUT
,
stdout
=
devnull
)
else
:
proc
=
subprocess
.
Popen
(
cmd
)
return
proc
python/tvm/target.py
View file @
7d2654c2
...
...
@@ -117,7 +117,7 @@ class Target(object):
self
.
keys
+=
(
"rocm"
,
"gpu"
)
self
.
max_num_threads
=
256
elif
target_name
in
(
"metal"
,
"vulkan"
):
self
.
keys
+=
(
"gpu"
,)
self
.
keys
+=
(
target_name
,
"gpu"
,)
self
.
max_num_threads
=
256
elif
target_name
in
(
"opengl"
,):
self
.
keys
+=
(
"opengl"
,)
...
...
src/codegen/codegen_metal.cc
View file @
7d2654c2
...
...
@@ -186,6 +186,20 @@ void CodeGenMetal::PrintStorageSync(const Call* op) {
}
}
void
CodeGenMetal
::
PrintVecElemLoad
(
const
std
::
string
&
vec
,
Type
t
,
int
i
,
std
::
ostream
&
os
)
{
// NOLINT(*)
os
<<
vec
<<
"["
<<
i
<<
"]"
;
}
void
CodeGenMetal
::
PrintVecElemStore
(
const
std
::
string
&
vec
,
Type
t
,
int
i
,
const
std
::
string
&
value
)
{
this
->
PrintIndent
();
stream
<<
vec
<<
"["
<<
i
<<
"]"
<<
" = "
<<
value
<<
";
\n
"
;
}
void
CodeGenMetal
::
PrintStorageScope
(
const
std
::
string
&
scope
,
std
::
ostream
&
os
)
{
// NOLINT(*)
if
(
scope
==
"global"
)
{
...
...
src/codegen/codegen_metal.h
View file @
7d2654c2
...
...
@@ -25,6 +25,12 @@ class CodeGenMetal final : public CodeGenC {
void
PrintStorageSync
(
const
Call
*
op
)
final
;
// NOLINT(*)
void
PrintType
(
Type
t
,
std
::
ostream
&
os
)
final
;
// NOLINT(*)
void
BindThreadIndex
(
const
IterVar
&
iv
)
final
;
// NOLINT(*)
// print load of single element
void
PrintVecElemLoad
(
const
std
::
string
&
vec
,
Type
t
,
int
i
,
std
::
ostream
&
os
)
final
;
// NOLINT(*)
// print store of single element.
void
PrintVecElemStore
(
const
std
::
string
&
vec
,
Type
t
,
int
i
,
const
std
::
string
&
value
)
final
;
// overload visitor
void
VisitExpr_
(
const
Broadcast
*
op
,
std
::
ostream
&
os
)
final
;
// NOLINT(*)
...
...
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