Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 2 additions & 9 deletions KLR/Core/LowerAP.lean
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,10 @@ abbrev LowerAP := StateT LowerAPState KLR.Err
/-- Function to convert an Access to an AccessPattern.
Note: This lowering does not work in all cases, for example, if the Access in an AccessBasic whose
Par dimension takes steps that are not equal to 1. Returns a None in this case. -/
partial def Access.lowerAccessPattern (a : Access) : LowerAP BirAccessPattern := do
def Access.lowerAccessPattern (a : Access) : LowerAP BirAccessPattern := do
-- Don't violate invariants of proved code
if let .birPattern b := a then
-- Lower vectorOffset if it exists and isn't already lowered
let vectorOffset <- b.vectorOffset.mapM fun vo =>
match vo with
| .birPattern _ => pure vo
| _ => do
let lowered <- vo.lowerAccessPattern
pure (.birPattern lowered)
return { b with vectorOffset }
return b

-- The layout of a tensor in memory
-- Note that because accesses are values, we have are forced to assume that all tensors are
Expand Down
Loading