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
1791b121
Commit
1791b121
authored
Oct 21, 2017
by
Wei Chen
Committed by
Tianqi Chen
Oct 21, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCHEDULE] Detect duplicate IterVar in reorder (#575)
parent
326edd76
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
0 deletions
+12
-0
src/schedule/schedule_lang.cc
+5
-0
tests/python/unittest/test_lang_schedule.py
+7
-0
No files found.
src/schedule/schedule_lang.cc
View file @
1791b121
...
...
@@ -259,6 +259,7 @@ Stage& Stage::fuse(IterVar outer, IterVar inner, IterVar* p_target) { // NOLINT
}
Stage
&
Stage
::
reorder
(
const
Array
<
IterVar
>&
order
)
{
// NOLINT(*)
std
::
unordered_set
<
IterVar
>
seen_var
;
StageNode
*
self
=
operator
->
();
for
(
IterVar
iv
:
order
)
{
CHECK
(
iv
->
iter_type
==
kDataPar
||
...
...
@@ -266,6 +267,10 @@ Stage& Stage::reorder(const Array<IterVar>& order) { // NOLINT(*)
iv
->
iter_type
==
kThreadIndex
)
<<
"Cannot reorder IterVar("
<<
IterVarType2String
(
iv
->
iter_type
)
<<
")"
;
CHECK_EQ
(
seen_var
.
count
(
iv
),
0
)
<<
"Same axis can not appear more than once "
<<
iv
;
seen_var
.
insert
(
iv
);
}
ArrayNode
*
all_vars
=
self
->
all_iter_vars
.
CopyOnWrite
();
ArrayNode
*
leaf_vars
=
self
->
leaf_iter_vars
.
CopyOnWrite
();
...
...
tests/python/unittest/test_lang_schedule.py
View file @
1791b121
...
...
@@ -43,6 +43,13 @@ def test_reorder():
assert
tuple
(
s
[
T
]
.
leaf_iter_vars
)
!=
order
s
[
T
]
.
reorder
(
*
order
)
assert
tuple
(
s
[
T
]
.
leaf_iter_vars
)
==
order
try
:
# pass duplicate IterVar
# must raise an error
s
[
T
]
.
reorder
(
xi2
,
xi1
,
xi2
)
assert
False
except
tvm
.
TVMError
:
pass
def
test_split
():
m
=
tvm
.
var
(
'm'
)
...
...
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