diff options
| author | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-12-08 20:09:31 +0100 |
|---|---|---|
| committer | Mikolaj Konarski <mikolaj.konarski@funktory.com> | 2025-12-08 22:56:43 +0100 |
| commit | 4cd80d336f78b419e9e1b80c2c20e0e07ecf10a0 (patch) | |
| tree | 9ec08ed3adbc388e79d537959cf011d5e43fb49a /src/Data/Array/Nested/Shaped/Base.hs | |
| parent | 9624e5d90d5f0815bec230cdd2f4e5b406805885 (diff) | |
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.
Diffstat (limited to 'src/Data/Array/Nested/Shaped/Base.hs')
| -rw-r--r-- | src/Data/Array/Nested/Shaped/Base.hs | 20 |
1 files changed, 0 insertions, 20 deletions
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) |
