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
f8f02829
Commit
f8f02829
authored
Feb 12, 2017
by
Tianqi Chen
Committed by
GitHub
Feb 12, 2017
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[SCHEDULE] Refactor bound inference logic (#41)
parent
5c07413c
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
11 deletions
+16
-11
include/tvm/schedule_pass.h
+1
-1
src/arithmetic/int_set.cc
+12
-10
src/arithmetic/int_set.h
+3
-0
src/schedule/bound.cc
+0
-0
No files found.
include/tvm/schedule_pass.h
View file @
f8f02829
...
@@ -22,7 +22,7 @@ namespace schedule {
...
@@ -22,7 +22,7 @@ namespace schedule {
* \param sch The root schedule to infer all the bounds.
* \param sch The root schedule to infer all the bounds.
* \return the result bound of the iteration Variable
* \return the result bound of the iteration Variable
*/
*/
Map
<
IterVar
,
Range
>
InferBound
(
Schedule
sch
);
Map
<
IterVar
,
Range
>
InferBound
(
const
Schedule
&
sch
);
/*!
/*!
* \brief Schedule s' dependent operations.
* \brief Schedule s' dependent operations.
...
...
src/arithmetic/int_set.cc
View file @
f8f02829
...
@@ -432,7 +432,6 @@ TVM_STATIC_IR_FUNCTOR(IntSetEvaluator, vtable)
...
@@ -432,7 +432,6 @@ TVM_STATIC_IR_FUNCTOR(IntSetEvaluator, vtable)
.
set_dispatch
<
And
>
(
Binary
<
And
>
)
.
set_dispatch
<
And
>
(
Binary
<
And
>
)
.
set_dispatch
<
Or
>
(
Binary
<
Or
>
);
.
set_dispatch
<
Or
>
(
Binary
<
Or
>
);
IntSet
EvalSet
(
Expr
e
,
IntSet
EvalSet
(
Expr
e
,
const
std
::
unordered_map
<
const
Variable
*
,
IntSet
>&
dom_map
)
{
const
std
::
unordered_map
<
const
Variable
*
,
IntSet
>&
dom_map
)
{
return
IntSetEvaluator
(
dom_map
).
Eval
(
e
);
return
IntSetEvaluator
(
dom_map
).
Eval
(
e
);
...
@@ -444,17 +443,12 @@ IntSet EvalSet(Expr e,
...
@@ -444,17 +443,12 @@ IntSet EvalSet(Expr e,
for
(
auto
kv
:
dom_map
)
{
for
(
auto
kv
:
dom_map
)
{
dmap
[
kv
.
first
->
var
.
as
<
Variable
>
()]
=
kv
.
second
;
dmap
[
kv
.
first
->
var
.
as
<
Variable
>
()]
=
kv
.
second
;
}
}
IntSetEvaluator
m
(
dmap
);
return
EvalSet
(
e
,
dmap
);
return
m
.
Eval
(
e
);
}
}
IntSet
EvalSet
(
Range
r
,
IntSet
EvalSet
(
Range
r
,
const
Map
<
IterVar
,
IntSet
>&
dom_map
)
{
const
std
::
unordered_map
<
const
Variable
*
,
IntSet
>&
dom_map
)
{
std
::
unordered_map
<
const
Variable
*
,
IntSet
>
dmap
;
IntSetEvaluator
m
(
dom_map
);
for
(
auto
kv
:
dom_map
)
{
dmap
[
kv
.
first
->
var
.
as
<
Variable
>
()]
=
kv
.
second
;
}
IntSetEvaluator
m
(
dmap
);
IntSet
min_set
=
m
.
Eval
(
r
->
min
);
IntSet
min_set
=
m
.
Eval
(
r
->
min
);
IntSet
ext_set
=
m
.
Eval
(
r
->
extent
).
cover_interval
();
IntSet
ext_set
=
m
.
Eval
(
r
->
extent
).
cover_interval
();
const
Interval
&
ei
=
ext_set
.
as
<
IntervalSet
>
()
->
i
;
const
Interval
&
ei
=
ext_set
.
as
<
IntervalSet
>
()
->
i
;
...
@@ -463,6 +457,15 @@ IntSet EvalSet(Range r,
...
@@ -463,6 +457,15 @@ IntSet EvalSet(Range r,
return
Combine
<
Add
>
(
min_set
,
ext_set
);
return
Combine
<
Add
>
(
min_set
,
ext_set
);
}
}
IntSet
EvalSet
(
Range
r
,
const
Map
<
IterVar
,
IntSet
>&
dom_map
)
{
std
::
unordered_map
<
const
Variable
*
,
IntSet
>
dmap
;
for
(
auto
kv
:
dom_map
)
{
dmap
[
kv
.
first
->
var
.
as
<
Variable
>
()]
=
kv
.
second
;
}
return
EvalSet
(
r
,
dmap
);
}
TVM_STATIC_IR_FUNCTOR
(
IRPrinter
,
vtable
)
TVM_STATIC_IR_FUNCTOR
(
IRPrinter
,
vtable
)
.
set_dispatch
<
IntervalSet
>
([](
const
IntervalSet
*
op
,
IRPrinter
*
p
)
{
.
set_dispatch
<
IntervalSet
>
([](
const
IntervalSet
*
op
,
IRPrinter
*
p
)
{
p
->
stream
<<
"interval-set["
p
->
stream
<<
"interval-set["
...
@@ -470,6 +473,5 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
...
@@ -470,6 +473,5 @@ TVM_STATIC_IR_FUNCTOR(IRPrinter, vtable)
<<
op
->
i
.
max
<<
']'
;
<<
op
->
i
.
max
<<
']'
;
});
});
}
// namespace arith
}
// namespace arith
}
// namespace tvm
}
// namespace tvm
src/arithmetic/int_set.h
View file @
f8f02829
...
@@ -103,6 +103,9 @@ IntSet EvalSet(Expr e,
...
@@ -103,6 +103,9 @@ IntSet EvalSet(Expr e,
*/
*/
IntSet
EvalSet
(
Range
r
,
IntSet
EvalSet
(
Range
r
,
const
Map
<
IterVar
,
IntSet
>&
dom_map
);
const
Map
<
IterVar
,
IntSet
>&
dom_map
);
IntSet
EvalSet
(
Range
r
,
const
std
::
unordered_map
<
const
Variable
*
,
IntSet
>&
dom_map
);
/*!
/*!
* \brief Create an union set of all sets
* \brief Create an union set of all sets
...
...
src/schedule/bound.cc
View file @
f8f02829
This diff is collapsed.
Click to expand it.
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