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
37734045
Commit
37734045
authored
Jan 24, 2018
by
Tianqi Chen
Committed by
GitHub
Jan 24, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CODE COMMENT] Comment BindBufferScope (#815)
parent
5fc4bc57
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
34 additions
and
1 deletions
+34
-1
src/pass/storage_flatten.cc
+34
-1
No files found.
src/pass/storage_flatten.cc
View file @
37734045
...
...
@@ -296,7 +296,40 @@ class StorageFlattener : public IRMutator {
}
private
:
// Start bind
// The specific tensor data layout is not determined before
// StorageFlatten pass. We use buffer_bind_scope
// to specify before hand we want to bind a subregion
// of tensor to a symbolic buffer, which get used in extern.
//
// Example:
//
// realize A in range [i*4, extent=10) {
// bind Ab to A in [i*4+1, extent=4) {
// call_func(Ab.ptr, Ab.shape[0])
// }
// }
//
// After StorageFlatten
//
// alloc A[10]
// call(A + 1, 4)
//
// Buffer is a protocol to declare specific
// data layout and shape we expect.
// So this function need to check:
// - If the bind range is within the realize range
// - If we can match the requirement of buffer
// - Remap variables such as Ab.ptr to the actual value.
//
// Here are a few possible failure cases:
// - Buffer is declared to have constant shape,
// but we try to bind it to a different one.
// - Buffer is declared to be compact(no strides)
// but this binded region is a subregion of
// a matrix(tensor), which means it requires strides.
//
// We do support a few relaxed case, such as bindingx
// region with shape [1, 1, n, m] to buffer with shape [n, m]
Stmt
HandleBufferBindScope
(
const
AttrStmt
*
op
)
{
Array
<
NodeRef
>
arr
(
op
->
node
.
node_
);
CHECK_EQ
(
arr
.
size
(),
2U
);
...
...
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