Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
elpa
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
14
Issues
14
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Environments
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
elpa
elpa
Commits
6893f028
Commit
6893f028
authored
Jun 12, 2019
by
Pavel Kus
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rewriting matrix-matrix multiplications by BLAS calls
parent
cf3cb8dc
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
8 deletions
+17
-8
src/elpa2/kernels/blas_block4_template.F90
src/elpa2/kernels/blas_block4_template.F90
+17
-8
No files found.
src/elpa2/kernels/blas_block4_template.F90
View file @
6893f028
...
...
@@ -85,7 +85,7 @@
real
(
kind
=
C_DATATYPE_KIND
)
::
h_mat
(
4
,
nb
+3
)
real
(
kind
=
C_DATATYPE_KIND
)
::
s_mat
(
4
,
4
)
integer
(
kind
=
ik
)
::
i
integer
(
kind
=
ik
)
::
i
,
j
,
k
! Calculate dot product of the two Householder vectors
...
...
@@ -102,24 +102,33 @@
h_mat
(
3
,
3
:
nb
+1
)
=
-
hh
(
2
:
nb
,
3
)
h_mat
(
4
,
2
:
nb
)
=
-
hh
(
2
:
nb
,
4
)
! TODO we actually need just the strictly upper triangle of s_mat
! TODO take care when changing to BLAS
! TODO we do not even need diagonal, which might not be achievable by blas.
! TODO lets see how much does it matter
s_mat
=
-
matmul
(
h_mat
,
transpose
(
h_mat
))
! TODO we do not need the diagonal, but how to do it with BLAS?
!s_mat = - matmul(h_mat, transpose(h_mat))
call
DSYRK
(
'L'
,
'N'
,
4
,
nb
+3
,
&
-1.0_rk8
,
h_mat
,
4
,
&
0.0_rk8
,
s_mat
,
4
)
s_mat
(
1
,
1
)
=
1
s_mat
(
2
,
2
)
=
1
s_mat
(
3
,
3
)
=
1
s_mat
(
4
,
4
)
=
1
w_comb
=
matmul
(
q
(
1
:
ldq
,
1
:
nb
+3
),
-
transpose
(
h_mat
))
! w_comb = - matmul(q(1:nq, 1:nb+3), transpose(h_mat))
call
DGEMM
(
'N'
,
'T'
,
nq
,
4
,
nb
+3
,
&
-1.0_rk8
,
q
,
ldq
,
&
h_mat
,
4
,
&
0.0_rk8
,
w_comb
,
nq
)
! Rank-1 update
do
i
=
1
,
4
w_comb
(
1
:
nq
,
i
)
=
matmul
(
w_comb
(
1
:
nq
,
1
:
i
),
hh
(
1
,
i
)
*
s_mat
(
i
,
1
:
i
))
enddo
q
(
1
:
nq
,
1
:
nb
+3
)
=
matmul
(
w_comb
,
h_mat
)
+
q
(
1
:
nq
,
1
:
nb
+3
)
!q(1:nq, 1:nb+3) = matmul(w_comb, h_mat) + q(1:nq, 1:nb+3)
call
DGEMM
(
'N'
,
'N'
,
nq
,
nb
+3
,
4
,
&
1.0_rk8
,
w_comb
,
nq
,
&
h_mat
,
4
,
&
1.0_rk8
,
q
,
ldq
)
end
subroutine
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment