Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix error message in Buffer::vstore, NFC #6056

Merged
merged 2 commits into from Jul 16, 2020
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/tir/ir/buffer.cc
Expand Up @@ -283,7 +283,7 @@ inline PrimExpr BufferOffset(const BufferNode* n, Array<PrimExpr> index, DataTyp
}

PrimExpr Buffer::vload(Array<PrimExpr> begin, DataType dtype) const {
// specially handle bool, stored asDataType::Int(8)
// specially handle bool, stored as DataType::Int(8)
const BufferNode* n = operator->();
CHECK(dtype.element_of() == n->dtype.element_of() && dtype.lanes() % n->dtype.lanes() == 0)
<< "Cannot load " << dtype << " from buffer of " << n->dtype;
Expand All @@ -297,11 +297,11 @@ PrimExpr Buffer::vload(Array<PrimExpr> begin, DataType dtype) const {
}

Stmt Buffer::vstore(Array<PrimExpr> begin, PrimExpr value) const {
// specially handle bool, stored asDataType::Int(8)
// specially handle bool, stored as DataType::Int(8)
const BufferNode* n = operator->();
DataType dtype = value.dtype();
CHECK(dtype.element_of() == n->dtype.element_of() && dtype.lanes() % n->dtype.lanes() == 0)
<< "Cannot load " << dtype << " from buffer of " << n->dtype;
<< "Cannot store " << dtype << " to buffer of " << n->dtype;
if (value.dtype() == DataType::Bool()) {
return tir::Store(n->data, tir::Cast(DataType::Int(8), value),
BufferOffset(n, begin, DataType::Int(8)), const_true());
Expand Down