From 4cd80d336f78b419e9e1b80c2c20e0e07ecf10a0 Mon Sep 17 00:00:00 2001 From: Mikolaj Konarski Date: Mon, 8 Dec 2025 20:09:31 +0100 Subject: Express mvecsWrite and mvecsWritePartial using the new methods and change the type of the latter to make it possible. This slightly improves performance of horde-ad tests, before horde-ad even starts using the Linear methods, which improves performance even more. --- src/Data/Array/Nested/Shaped/Base.hs | 20 -------------------- 1 file changed, 20 deletions(-) (limited to 'src/Data/Array/Nested/Shaped/Base.hs') diff --git a/src/Data/Array/Nested/Shaped/Base.hs b/src/Data/Array/Nested/Shaped/Base.hs index 9fc2c9a..e5dd852 100644 --- a/src/Data/Array/Nested/Shaped/Base.hs +++ b/src/Data/Array/Nested/Shaped/Base.hs @@ -142,32 +142,12 @@ instance Elt a => Elt (Shaped sh a) where marrayStrides (M_Shaped arr) = marrayStrides arr - mvecsWrite :: forall sh' s. IShX sh' -> IIxX sh' -> Shaped sh a -> MixedVecs s sh' (Shaped sh a) -> ST s () - mvecsWrite sh idx (Shaped arr) vecs = - mvecsWrite sh idx arr - (coerce @(MixedVecs s sh' (Shaped sh a)) @(MixedVecs s sh' (Mixed (MapJust sh) a)) - vecs) - mvecsWriteLinear :: forall sh' s. Int -> Shaped sh a -> MixedVecs s sh' (Shaped sh a) -> ST s () mvecsWriteLinear idx (Shaped arr) vecs = mvecsWriteLinear idx arr (coerce @(MixedVecs s sh' (Shaped sh a)) @(MixedVecs s sh' (Mixed (MapJust sh) a)) vecs) - mvecsWritePartial - :: forall sh1 sh2 s. - IShX (sh1 ++ sh2) -> IIxX sh1 -> Mixed sh2 (Shaped sh a) - -> MixedVecs s (sh1 ++ sh2) (Shaped sh a) - -> ST s () - mvecsWritePartial sh idx arr vecs = - mvecsWritePartial sh idx - (coerce @(Mixed sh2 (Shaped sh a)) - @(Mixed sh2 (Mixed (MapJust sh) a)) - arr) - (coerce @(MixedVecs s (sh1 ++ sh2) (Shaped sh a)) - @(MixedVecs s (sh1 ++ sh2) (Mixed (MapJust sh) a)) - vecs) - mvecsWritePartialLinear :: forall sh1 sh2 s. Proxy sh1 -> Int -> Mixed sh2 (Shaped sh a) -- cgit v1.2.3-70-g09d2