1
- function mixedtrsm! (side, uplo, trans, diag, alpha, A, B, StoragePrecision)
1
+ @inline function mixedtrsm! (side, uplo, trans, diag, alpha, A, B, StoragePrecision)
2
2
T = StoragePrecision
3
+ m, n = size (B)
3
4
if typeof (B) != Matrix{T}
4
- println (" B is not of type $T but of type $(typeof (B)) " )
5
5
if typeof (A) != Matrix{T}
6
6
Acopy = convert (Matrix{T}, A)
7
7
else
8
8
Acopy = A
9
9
end
10
10
Bcopy = convert (Matrix{T}, B)
11
11
BLAS. trsm! (side, uplo, trans, diag, T (alpha), Acopy, Bcopy)
12
+ copyto! (B, Bcopy)
13
+ return B
12
14
end
13
15
BLAS. trsm! (side, uplo, trans, diag, alpha, A, B)
16
+ return B
14
17
end
15
- function mixedgemm! (transa, transb, alpha, A, B, beta, C, StoragePrecision)
18
+ @inline function mixedgemm! (transa, transb, alpha, A, B, beta, C, StoragePrecision)
16
19
T = StoragePrecision
20
+ m, n = size (C)
17
21
if typeof (C) != Matrix{T}
18
22
if typeof (A) != Matrix{T}
19
23
Acopy = convert (Matrix{T}, A)
@@ -27,11 +31,15 @@ function mixedgemm!(transa, transb, alpha, A, B, beta, C, StoragePrecision)
27
31
end
28
32
Ccopy = convert (Matrix{T}, C)
29
33
BLAS. gemm! (transa, transb, T (alpha), Acopy, Bcopy, T (beta), Ccopy)
34
+ copyto! (C, Ccopy)
35
+ return C
30
36
end
31
37
BLAS. gemm! (transa, transb, alpha, A, B, beta, C)
38
+ return C
32
39
end
33
- function mixedsyrk! (uplo, trans, alpha, A, beta, C, StoragePrecision)
40
+ @inline function mixedsyrk! (uplo, trans, alpha, A, beta, C, StoragePrecision)
34
41
T = StoragePrecision
42
+ m, n = size (C)
35
43
if typeof (C) != Matrix{T}
36
44
if typeof (A) != Matrix{T}
37
45
Acopy = convert (Matrix{T}, A)
@@ -40,10 +48,13 @@ function mixedsyrk!(uplo, trans, alpha, A, beta, C, StoragePrecision)
40
48
end
41
49
Ccopy = convert (Matrix{T}, C)
42
50
BLAS. syrk! (uplo, trans, T (alpha), Acopy, T (beta), Ccopy)
51
+ copyto! (C, Ccopy)
52
+ return C
43
53
end
44
54
BLAS. syrk! (uplo, trans, alpha, A, beta, C)
55
+ return C
45
56
end
46
- function mixedherk! (uplo, trans, alpha, A, beta, C, StoragePrecision)
57
+ @inline function mixedherk! (uplo, trans, alpha, A, beta, C, StoragePrecision)
47
58
T = StoragePrecision
48
59
if typeof (C) != Matrix{T}
49
60
if typeof (A) != Matrix{T}
@@ -53,10 +64,13 @@ function mixedherk!(uplo, trans, alpha, A, beta, C, StoragePrecision)
53
64
end
54
65
Ccopy = convert (Matrix{T}, C)
55
66
BLAS. herk! (uplo, trans, T (alpha), Acopy, T (beta), Ccopy)
67
+ copyto! (C, Ccopy)
68
+ return C
56
69
end
57
70
BLAS. herk! (uplo, trans, alpha, A, beta, C)
71
+ return C
58
72
end
59
- function MixedPrecisionChol! (A:: DArray{T,2 } , :: Type{LowerTriangular} , MP:: Matrix{DataType} ) where T
73
+ function MixedPrecisionChol! (A:: DMatrix{T } , :: Type{LowerTriangular} , MP:: Matrix{DataType} ) where T
60
74
LinearAlgebra. checksquare (A)
61
75
62
76
zone = one (T)
@@ -124,7 +138,7 @@ function MixedPrecisionChol!(A::DArray{T,2}, ::Type{UpperTriangular}, MP::Matrix
124
138
if iscomplex
125
139
Dagger. @spawn mixedherk! (uplo, ' C' , rmzone, In (Ac[k, m]), rzone, InOut (Ac[m, m]))
126
140
else
127
- Dagger. @spawn mixedherk ! (uplo, ' T' , rmzone, In (Ac[k, m]), rzone, InOut (Ac[m, m]))
141
+ Dagger. @spawn mixedsyrk ! (uplo, ' T' , rmzone, In (Ac[k, m]), rzone, InOut (Ac[m, m]))
128
142
end
129
143
for n in range (m+ 1 , nt)
130
144
Dagger. @spawn mixedgemm! (trans, ' N' , mzone, In (Ac[k, m]), In (Ac[k, n]), zone, InOut (Ac[m, n]))
0 commit comments