Page MenuHomePhabricator

[mlir] support creating memref descriptors from static shape with non-zero offset

Authored by gysit on Wed, Feb 12, 3:07 AM.



This patch adapts the method MemRefDescriptor::fromStaticShape to support static non-zero offsets. The updated method uses the getStridesAndOffset method to extract strides and offset. The patch also adapts the test cases since sizes and strides are now set in forward instead of reverse order.

Diff Detail

Event Timeline

gysit created this revision.Wed, Feb 12, 3:07 AM
ftynse requested changes to this revision.Wed, Feb 12, 6:19 AM

Can you add a tests where the non-zero offset is exercised?

Nit: you could have kept the loop order reversed to spare yourself the effort of changing the tests.

This revision now requires changes to proceed.Wed, Feb 12, 6:19 AM
gysit updated this revision to Diff 244169.Wed, Feb 12, 7:00 AM

I added a test for a memref with a non-zero offset and non-standard strides. Let me know if you had another test in mind...

ftynse accepted this revision.Wed, Feb 12, 1:32 PM


This revision is now accepted and ready to land.Wed, Feb 12, 1:32 PM
This revision was automatically updated to reflect the committed changes.