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
d949c742
Commit
d949c742
authored
Apr 06, 2018
by
Leyuan Wang
Committed by
Tianqi Chen
Apr 06, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Intel target added, sub group sync added (#1084)
parent
14181340
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
3 deletions
+28
-3
include/tvm/build_module.h
+4
-0
python/tvm/target.py
+14
-0
src/codegen/build_module.cc
+8
-2
src/codegen/codegen_opencl.cc
+2
-1
No files found.
include/tvm/build_module.h
View file @
d949c742
...
...
@@ -154,6 +154,10 @@ EXPORT Target rasp(const std::vector<std::string>& options =
EXPORT
Target
mali
(
const
std
::
vector
<
std
::
string
>&
options
=
std
::
vector
<
std
::
string
>
());
/*! \return A target for Intel GPU */
EXPORT
Target
intel_gpu
(
const
std
::
vector
<
std
::
string
>&
options
=
std
::
vector
<
std
::
string
>
());
/*! \return A target for stackvm */
EXPORT
Target
stackvm
(
const
std
::
vector
<
std
::
string
>&
options
=
std
::
vector
<
std
::
string
>
());
...
...
python/tvm/target.py
View file @
d949c742
...
...
@@ -76,6 +76,7 @@ class Target(NodeBase):
- :any:`tvm.target.cuda` create CUDA target
- :any:`tvm.target.rocm` create ROCM target
- :any:`tvm.target.mali` create Mali target
- :any:`tvm.target.intel_gpu` create Intel GPU target
"""
def
__init__
(
self
,
handle
):
super
(
Target
,
self
)
.
__init__
(
handle
)
...
...
@@ -397,6 +398,19 @@ def mali(options=None):
return
_api_internal
.
_TargetCreate
(
"opencl"
,
*
opts
)
def
intel_gpu
(
options
=
None
):
"""Returns an Intel GPU target.
Parameters
----------
options : str or list of str
Additional options
"""
opts
=
[
"-device=intel_gpu"
]
opts
=
_merge_opts
(
opts
,
options
)
return
_api_internal
.
_TargetCreate
(
"opencl"
,
*
opts
)
def
opengl
(
options
=
None
):
"""Returns a OpenGL target.
...
...
src/codegen/build_module.cc
View file @
d949c742
...
...
@@ -74,6 +74,9 @@ Target CreateTarget(const std::string& target_name,
t
->
keys_array
.
push_back
(
ir
::
StringImm
::
make
(
"rocm"
));
t
->
keys_array
.
push_back
(
ir
::
StringImm
::
make
(
"gpu"
));
t
->
max_num_threads
=
256
;
if
(
device_name
==
"intel_gpu"
)
{
t
->
thread_warp_size
=
16
;
}
}
else
if
(
target_name
==
"metal"
||
target_name
==
"vulkan"
)
{
t
->
device_type
=
static_cast
<
int
>
(
target_name
==
"metal"
?
kDLMetal
:
kDLVulkan
);
t
->
keys_array
.
push_back
(
ir
::
StringImm
::
make
(
target_name
));
...
...
@@ -182,8 +185,6 @@ Target Target::create(const std::string& target_str) {
if
(
device_name
==
"rasp"
)
{
return
target
::
rasp
(
options
);
}
else
if
(
device_name
==
"mail"
)
{
return
target
::
mali
(
options
);
}
else
{
return
CreateTarget
(
target_name
,
options
);
}
...
...
@@ -264,6 +265,11 @@ Target mali(const std::vector<std::string>& options) {
}));
}
Target
intel_gpu
(
const
std
::
vector
<
std
::
string
>&
options
)
{
return
CreateTarget
(
"opencl"
,
MergeOptions
(
options
,
{
"-device=intel_gpu"
}));
}
Target
stackvm
(
const
std
::
vector
<
std
::
string
>&
options
)
{
return
CreateTarget
(
"stackvm"
,
options
);
...
...
src/codegen/codegen_opencl.cc
View file @
d949c742
...
...
@@ -157,7 +157,8 @@ void CodeGenOpenCL::PrintVecStore(const Variable* buffer,
void
CodeGenOpenCL
::
PrintStorageSync
(
const
Call
*
op
)
{
const
std
::
string
&
sync
=
op
->
args
[
0
].
as
<
StringImm
>
()
->
value
;
if
(
sync
==
"warp"
)
{
LOG
(
FATAL
)
<<
"warp sync not supported in opencl"
;
this
->
PrintIndent
();
this
->
stream
<<
"sub_group_barrier(CLK_LOCAL_MEM_FENCE);
\n
"
;
}
else
if
(
sync
==
"shared"
)
{
this
->
PrintIndent
();
this
->
stream
<<
"barrier(CLK_LOCAL_MEM_FENCE);
\n
"
;
...
...
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