diff --git a/cinnamon/lib/Dialect/Cinm/Interfaces/TilingInterface.cpp b/cinnamon/lib/Dialect/Cinm/Interfaces/TilingInterface.cpp index 3c7e4e6..4e7d18f 100644 --- a/cinnamon/lib/Dialect/Cinm/Interfaces/TilingInterface.cpp +++ b/cinnamon/lib/Dialect/Cinm/Interfaces/TilingInterface.cpp @@ -120,9 +120,10 @@ int64_t TilingParameters::bufferSizeOfLeaf() { int64_t bufSize = 0; int i = 0; do { - int lastIdx = bufferSizesInBytes.size() - 1 - i; + size_t lastIdx = bufferSizesInBytes.size() - 1 - i; bufSize += bufferSizesInBytes[lastIdx] / numLeafsInDim; - numLeafsInDim *= workgroupShape[lastIdx]; + numLeafsInDim *= + lastIdx < workgroupShape.size() ? workgroupShape[lastIdx] : 1; i++; } while (i < static_cast(bufferSizesInBytes.size())); return bufSize;