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
2d9bc751
Commit
2d9bc751
authored
Oct 14, 2018
by
Wei Chen
Committed by
Tianqi Chen
Oct 14, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add test to confirm that we forbid allocate statement referencing undefined variable (#1899)
parent
fc341e1c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
0 deletions
+17
-0
tests/python/unittest/test_pass_split_host_device.py
+17
-0
No files found.
tests/python/unittest/test_pass_split_host_device.py
0 → 100644
View file @
2d9bc751
from
nose.tools
import
raises
import
tvm
@raises
(
Exception
)
def
test_loop_dependent_allocate
():
N
=
tvm
.
var
(
"N"
)
A
=
tvm
.
placeholder
((
2
*
N
,),
"float32"
,
"A"
)
C
=
tvm
.
compute
((
N
,
),
lambda
i
:
A
[
2
*
i
]
+
A
[
i
+
1
],
name
=
'C'
)
s
=
tvm
.
create_schedule
(
C
.
op
)
AA
=
s
.
cache_read
(
A
,
"local"
,
[
C
])
s
[
AA
]
.
compute_at
(
s
[
C
],
s
[
C
]
.
op
.
axis
[
0
])
# this line should fail due to IRUseDefAnalysis sees an allocate statement
# referencing undefined variable
tvm
.
lower
(
s
,
[
A
,
C
])
if
__name__
==
"__main__"
:
test_loop_dependent_allocate
()
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