-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathBLAS.hs
More file actions
37 lines (30 loc) · 994 Bytes
/
BLAS.hs
File metadata and controls
37 lines (30 loc) · 994 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
module ArrayFire.BLAS where
import Foreign.Marshal
import Foreign.Storable
import Foreign.C.String
import ArrayFire.Internal.BLAS
import ArrayFire.Exception
import ArrayFire.FFI
import ArrayFire.Types
import ArrayFire.Internal.Defines
matmul :: Array a -> Array a -> MatProp -> MatProp -> Array a
matmul arr1 arr2 prop1 prop2 = do
op2 arr1 arr2 (\p a b -> af_matmul p a b (toMatProp prop1) (toMatProp prop2))
dot :: Array a -> Array a -> AFMatProp -> AFMatProp -> Array a
dot arr1 arr2 prop1 prop2 = do
op2 arr1 arr2 (\p a b -> af_dot p a b prop1 prop2)
dotAll
:: Array a
-> Array a
-> MatProp
-> MatProp
-> (Double, Double)
dotAll arr1 arr2 prop1 prop2 =
infoFromArray22 arr1 arr2 $ \a b c d ->
af_dot_all a b c d (toMatProp prop1) (toMatProp prop2)
transpose :: Array a -> Bool -> Array a
transpose arr1 b =
arr1 `op1` (\x y -> af_transpose x y b)
transposeInPlace :: Array a -> Bool -> Array a
transposeInPlace arr b =
arr `inPlace` (`af_transpose_inplace` b)