File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
lib/Dialect/TritonNvidiaGPU/Transforms Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ struct MemoryBitMap {
4343 }
4444 void alloc (const TMemChunk &chunk) {
4545 // Ensure the underlying data fits the allocation.
46- while ((chunk.startCol + chunk.numCols ) * chunk. numRows >= elements.size ())
46+ while ((chunk.startCol + chunk.numCols ) * kNumRows >= elements.size ())
4747 elements.resize (2 * elements.size (), false );
4848
4949 for (int i = 0 ; i < chunk.numCols ; i++) {
@@ -92,8 +92,13 @@ struct MemoryBitMap {
9292 }
9393
9494private:
95- bool isUsed (int row, int col) const { return elements[row + col * kNumRows ]; }
95+ bool isUsed (int row, int col) const {
96+ if (row + col * kNumRows >= elements.size ())
97+ return false ;
98+ return elements[row + col * kNumRows ];
99+ }
96100 void setUsed (int row, int col, bool used) {
101+ assert (row + col * kNumRows < elements.size ());
97102 elements[row + col * kNumRows ] = used;
98103 }
99104
You can’t perform that action at this time.
0 commit comments