[LANG] Now requiring tiles have power of 2 number of elements

This commit is contained in:
Philippe Tillet
2021-02-04 16:13:10 -05:00
parent cc84a476a3
commit b8a52c70c9
4 changed files with 25 additions and 25 deletions

View File

@@ -110,11 +110,6 @@ ArrayType* ArrayType::New(Expr* expr, QualType eleType) {
ArrayType(&arrayTypePool, expr, eleType);
}
TileType* TileType::New(const ShapeExpr &expr, QualType eleType) {
return new (tileTypePool.Alloc())
TileType(&tileTypePool, expr, eleType);
}
TileType* TileType::New(const ShapeInt &shape, QualType eleType) {
return new (tileTypePool.Alloc())
TileType(&tileTypePool, shape, eleType);
@@ -316,6 +311,15 @@ bool ArrayType::Compatible(const Type& other) const {
return true;
}
TileType::TileType(MemPool* pool, const ShapeInt& shape, QualType derived)
: DerivedType(pool, derived),
shape_(shape) {
bool isComplete = true;
for(int s: shape_)
isComplete = isComplete && (s>=0);
SetComplete(isComplete);
}
bool TileType::Compatible(const Type& other) const {
// For two tile type to be compatible,
// the element types must be compatible