File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
third_party/intel/lib/TritonIntelGPUToLLVM Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -354,8 +354,16 @@ struct BlockIOConversionBase : public LoadStoreConversionBase {
354354 constexpr int MIN_PITCH = 64 ;
355355 if (stride == 0 )
356356 return b.i32_val (MIN_PITCH);
357- else if (stride != -1 )
358- return b.i32_val (stride * elemSizeInBits / 8 );
357+ else if (stride > 0 ) {
358+ // Only support stride > 0 for 2d block io.
359+ unsigned pitch = (unsigned )stride * elemSizeInBits / 8 ;
360+ if (pitch < MIN_PITCH)
361+ return nullptr ; // return null for unsupported pitch.
362+ else
363+ return b.i32_val (pitch);
364+ } else if (stride < 0 ) {
365+ assert (stride == -1 && " invalid stride < 0" );
366+ }
359367
360368 // ptrs[{0, 0}] and ptrs[{1, 0}] are currently used to calculate the
361369 // pitch.
You can’t perform that action at this time.
0 commit comments