diff options
author | Tom Smeding <tom@tomsmeding.com> | 2024-06-17 13:08:13 +0200 |
---|---|---|
committer | Tom Smeding <tom@tomsmeding.com> | 2024-06-17 13:08:13 +0200 |
commit | 9b0651bf19e889dfb28ba81b6ada25b27b0e6071 (patch) | |
tree | 53dafa55d48d9b73f148426ba5a308cc8cfa6410 /src/Data/Array/Mixed/Internal/Arith/Foreign.hs | |
parent | 3d48baae00c066f43fa2205b22f0357f069888f2 (diff) |
sumAllPrim
Diffstat (limited to 'src/Data/Array/Mixed/Internal/Arith/Foreign.hs')
-rw-r--r-- | src/Data/Array/Mixed/Internal/Arith/Foreign.hs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/Data/Array/Mixed/Internal/Arith/Foreign.hs b/src/Data/Array/Mixed/Internal/Arith/Foreign.hs index a406dab..ca96093 100644 --- a/src/Data/Array/Mixed/Internal/Arith/Foreign.hs +++ b/src/Data/Array/Mixed/Internal/Arith/Foreign.hs @@ -49,9 +49,13 @@ $(fmap concat . forM floatTypesList $ \arithtype -> do $(fmap concat . forM typesList $ \arithtype -> do let ttyp = conT (atType arithtype) - let base = "reduce_" ++ atCName arithtype - pure . ForeignD . ImportF CCall Unsafe ("oxarop_" ++ base) (mkName ("c_" ++ base)) <$> - [t| CInt -> Int64 -> Ptr Int64 -> Ptr Int64 -> Ptr $ttyp -> Ptr $ttyp -> IO () |]) + let base1 = "reduce1_" ++ atCName arithtype + basefull = "reducefull_" ++ atCName arithtype + sequence + [ForeignD . ImportF CCall Unsafe ("oxarop_" ++ base1) (mkName ("c_" ++ base1)) <$> + [t| CInt -> Int64 -> Ptr Int64 -> Ptr Int64 -> Ptr $ttyp -> Ptr $ttyp -> IO () |] + ,ForeignD . ImportF CCall Unsafe ("oxarop_" ++ basefull) (mkName ("c_" ++ basefull)) <$> + [t| CInt -> Int64 -> Ptr Int64 -> Ptr Int64 -> Ptr $ttyp -> IO $ttyp |]]) $(fmap concat . forM typesList $ \arithtype -> fmap concat . forM ["min", "max"] $ \fname -> do |