Commit b0d9f299 by Tianqi Chen Committed by GitHub

[PASS] Check memory info bound to guard failure (#409)

parent 0138997f
...@@ -140,6 +140,8 @@ class StorageFlattener : public IRMutator { ...@@ -140,6 +140,8 @@ class StorageFlattener : public IRMutator {
MemoryInfo info = GetMemoryInfo(skey.to_string()); MemoryInfo info = GetMemoryInfo(skey.to_string());
if (info.defined()) { if (info.defined()) {
align = (info->max_simd_bits + op->type.bits() - 1) / op->type.bits(); align = (info->max_simd_bits + op->type.bits() - 1) / op->type.bits();
CHECK_LE(const_size * op->type.bits(), info->max_num_bits)
<< "Allocation exceed bound of memory tag " << skey.to_string();
} }
} }
Array<Expr> strides; Array<Expr> strides;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment