Memref descriptors contain an `offset` field that denotes the start of the content of the memref relative to the `alignedPtr`. This offset is not considered when converting a memref descriptor to a np.array in the Python runtime library, essentially treating all memrefs as if they had an offset of zero. This patch introduces the necessary pointer arithmetic to find the actual beginning of the memref contents to the memref->numpy conversion functions. There is an ongoing discussion about whether the `offset` field is needed at all in the memref descriptor. Until that is decided, the Python runtime and CRunnerUtils should still correctly implement the offset handling. Related: https://reviews.llvm.org/D157008 Reviewed By: ftynse Differential Revision: https://reviews.llvm.org/D158494
24 KiB
24 KiB