blas.bend
bend-blas-lapack@0.0.0.1 · 98 lines · 18 definitions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20import Base
21
22
23
24
25
26def Blas.sgemm(ta: U32, tb: U32, m: U32, n: U32, k: U32, alpha: F32, a: Array<F32>, b: Array<F32>, beta: F32, c: Array<F32>) -> IO(Result<&1, &1, U32 & String, Array<F32>>):
27 import "./effs/blas_sgemm.c"
28 import "./effs/blas_sgemm.js"
29
30def Blas.sgemm.try(ta: U32, tb: U32, m: U32, n: U32, k: U32, alpha: F32, a: Array<F32>, b: Array<F32>, beta: F32, c: Array<F32>) -> IO(Array<F32>):
31 IO.try(Array<F32>, Blas.sgemm(ta, tb, m, n, k, alpha, a, b, beta, c))
32
33
34
35
36def Blas.sgemv(ta: U32, m: U32, n: U32, alpha: F32, a: Array<F32>, x: Array<F32>, beta: F32, y: Array<F32>) -> IO(Result<&1, &1, U32 & String, Array<F32>>):
37 import "./effs/blas_sgemv.c"
38 import "./effs/blas_sgemv.js"
39
40def Blas.sgemv.try(ta: U32, m: U32, n: U32, alpha: F32, a: Array<F32>, x: Array<F32>, beta: F32, y: Array<F32>) -> IO(Array<F32>):
41 IO.try(Array<F32>, Blas.sgemv(ta, m, n, alpha, a, x, beta, y))
42
43
44
45def Blas.sger(m: U32, n: U32, alpha: F32, x: Array<F32>, y: Array<F32>, a: Array<F32>) -> IO(Result<&1, &1, U32 & String, Array<F32>>):
46 import "./effs/blas_sger.c"
47 import "./effs/blas_sger.js"
48
49def Blas.sger.try(m: U32, n: U32, alpha: F32, x: Array<F32>, y: Array<F32>, a: Array<F32>) -> IO(Array<F32>):
50 IO.try(Array<F32>, Blas.sger(m, n, alpha, x, y, a))
51
52
53def Blas.sdot(n: U32, x: Array<F32>, y: Array<F32>) -> IO(Result<&1, &1, U32 & String, F32>):
54 import "./effs/blas_sdot.c"
55 import "./effs/blas_sdot.js"
56
57def Blas.sdot.try(n: U32, x: Array<F32>, y: Array<F32>) -> IO(F32):
58 IO.try(F32, Blas.sdot(n, x, y))
59
60
61def Blas.snrm2(n: U32, x: Array<F32>) -> IO(Result<&1, &1, U32 & String, F32>):
62 import "./effs/blas_snrm2.c"
63 import "./effs/blas_snrm2.js"
64
65def Blas.snrm2.try(n: U32, x: Array<F32>) -> IO(F32):
66 IO.try(F32, Blas.snrm2(n, x))
67
68
69def Blas.sasum(n: U32, x: Array<F32>) -> IO(Result<&1, &1, U32 & String, F32>):
70 import "./effs/blas_sasum.c"
71 import "./effs/blas_sasum.js"
72
73def Blas.sasum.try(n: U32, x: Array<F32>) -> IO(F32):
74 IO.try(F32, Blas.sasum(n, x))
75
76
77def Blas.isamax(n: U32, x: Array<F32>) -> IO(Result<&1, &1, U32 & String, U32>):
78 import "./effs/blas_isamax.c"
79 import "./effs/blas_isamax.js"
80
81def Blas.isamax.try(n: U32, x: Array<F32>) -> IO(U32):
82 IO.try(U32, Blas.isamax(n, x))
83
84
85def Blas.saxpy(n: U32, alpha: F32, x: Array<F32>, y: Array<F32>) -> IO(Result<&1, &1, U32 & String, Array<F32>>):
86 import "./effs/blas_saxpy.c"
87 import "./effs/blas_saxpy.js"
88
89def Blas.saxpy.try(n: U32, alpha: F32, x: Array<F32>, y: Array<F32>) -> IO(Array<F32>):
90 IO.try(Array<F32>, Blas.saxpy(n, alpha, x, y))
91
92
93def Blas.sscal(n: U32, alpha: F32, x: Array<F32>) -> IO(Result<&1, &1, U32 & String, Array<F32>>):
94 import "./effs/blas_sscal.c"
95 import "./effs/blas_sscal.js"
96
97def Blas.sscal.try(n: U32, alpha: F32, x: Array<F32>) -> IO(Array<F32>):
98 IO.try(Array<F32>, Blas.sscal(n, alpha, x))