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
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
28 additions
and
1 deletions
+28
-1
apps/ios_rpc/tests/ios_rpc_test.py
+1
-0
python/tvm/contrib/xcode.py
+6
-0
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():
...
@@ -59,6 +59,7 @@ def test_rpc_module():
# Start RPC test server that contains the compiled library.
# Start RPC test server that contains the compiled library.
server
=
xcode
.
popen_test_rpc
(
proxy_host
,
proxy_port
,
key
,
server
=
xcode
.
popen_test_rpc
(
proxy_host
,
proxy_port
,
key
,
destination
=
destination
,
destination
=
destination
,
options
=
[
'-quiet'
],
libs
=
[
path_dso1
,
path_dso2
])
libs
=
[
path_dso1
,
path_dso2
])
# connect to the proxy
# connect to the proxy
...
...
python/tvm/contrib/xcode.py
View file @
7d2654c2
...
@@ -201,5 +201,11 @@ def popen_test_rpc(host,
...
@@ -201,5 +201,11 @@ def popen_test_rpc(host,
if
options
:
if
options
:
cmd
+=
options
cmd
+=
options
cmd
+=
[
"test"
]
cmd
+=
[
"test"
]
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
)
proc
=
subprocess
.
Popen
(
cmd
)
return
proc
return
proc
python/tvm/target.py
View file @
7d2654c2
...
@@ -117,7 +117,7 @@ class Target(object):
...
@@ -117,7 +117,7 @@ class Target(object):
self
.
keys
+=
(
"rocm"
,
"gpu"
)
self
.
keys
+=
(
"rocm"
,
"gpu"
)
self
.
max_num_threads
=
256
self
.
max_num_threads
=
256
elif
target_name
in
(
"metal"
,
"vulkan"
):
elif
target_name
in
(
"metal"
,
"vulkan"
):
self
.
keys
+=
(
"gpu"
,)
self
.
keys
+=
(
target_name
,
"gpu"
,)
self
.
max_num_threads
=
256
self
.
max_num_threads
=
256
elif
target_name
in
(
"opengl"
,):
elif
target_name
in
(
"opengl"
,):
self
.
keys
+=
(
"opengl"
,)
self
.
keys
+=
(
"opengl"
,)
...
...
src/codegen/codegen_metal.cc
View file @
7d2654c2
...
@@ -186,6 +186,20 @@ void CodeGenMetal::PrintStorageSync(const Call* op) {
...
@@ -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
(
void
CodeGenMetal
::
PrintStorageScope
(
const
std
::
string
&
scope
,
std
::
ostream
&
os
)
{
// NOLINT(*)
const
std
::
string
&
scope
,
std
::
ostream
&
os
)
{
// NOLINT(*)
if
(
scope
==
"global"
)
{
if
(
scope
==
"global"
)
{
...
...
src/codegen/codegen_metal.h
View file @
7d2654c2
...
@@ -25,6 +25,12 @@ class CodeGenMetal final : public CodeGenC {
...
@@ -25,6 +25,12 @@ class CodeGenMetal final : public CodeGenC {
void
PrintStorageSync
(
const
Call
*
op
)
final
;
// NOLINT(*)
void
PrintStorageSync
(
const
Call
*
op
)
final
;
// NOLINT(*)
void
PrintType
(
Type
t
,
std
::
ostream
&
os
)
final
;
// NOLINT(*)
void
PrintType
(
Type
t
,
std
::
ostream
&
os
)
final
;
// NOLINT(*)
void
BindThreadIndex
(
const
IterVar
&
iv
)
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
// overload visitor
void
VisitExpr_
(
const
Broadcast
*
op
,
std
::
ostream
&
os
)
final
;
// NOLINT(*)
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