annotate liboctave/external/blas-xtra/ddot3.f @ 30564:796f54d4ddbf stable

update Octave Project Developers copyright for the new year In files that have the "Octave Project Developers" copyright notice, update for 2021. In all .txi and .texi files except gpl.txi and gpl.texi in the doc/liboctave and doc/interpreter directories, change the copyright to "Octave Project Developers", the same as used for other source files. Update copyright notices for 2022 (not done since 2019). For gpl.txi and gpl.texi, change the copyright notice to be "Free Software Foundation, Inc." and leave the date at 2007 only because this file only contains the text of the GPL, not anything created by the Octave Project Developers. Add Paul Thomas to contributors.in.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Dec 2021 18:22:40 -0500
parents 0a5b15007766
children 597f3ee61a48
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
30564
796f54d4ddbf update Octave Project Developers copyright for the new year
John W. Eaton <jwe@octave.org>
parents: 29358
diff changeset
1 c Copyright (C) 2009-2022 The Octave Project Developers
27918
b442ec6dda5c use centralized file for copyright info for individual contributors
John W. Eaton <jwe@octave.org>
parents: 26376
diff changeset
2 c
27923
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
3 c See the file COPYRIGHT.md in the top-level directory of this
bd51beb6205e update formatting of copyright notices
John W. Eaton <jwe@octave.org>
parents: 27919
diff changeset
4 c distribution or <https://octave.org/copyright/>.
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
5 c
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
6 c This file is part of Octave.
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
7 c
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23434
diff changeset
8 c Octave is free software: you can redistribute it and/or modify it
22802
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
9 c under the terms of the GNU General Public License as published by
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23434
diff changeset
10 c the Free Software Foundation, either version 3 of the License, or
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
11 c (at your option) any later version.
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
12 c
22802
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
13 c Octave is distributed in the hope that it will be useful, but
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
14 c WITHOUT ANY WARRANTY; without even the implied warranty of
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
15 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
16 c GNU General Public License for more details.
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
17 c
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
18 c You should have received a copy of the GNU General Public License
22802
0dcff7695e26 maint: Update more Copyright statements to use standard form.
Rik <rik@octave.org>
parents: 22323
diff changeset
19 c along with Octave; see the file COPYING. If not, see
24534
194eb4bd202b maint: Update punctuation for GPL v3 license text.
Rik <rik@octave.org>
parents: 23434
diff changeset
20 c <https://www.gnu.org/licenses/>.
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
21 c
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
22 subroutine ddot3(m,n,k,a,b,c)
13141
e81ddf9cacd5 maint: untabify and remove trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
23 c purpose: a 3-dimensional dot product.
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
24 c c = sum (a .* b, 2), where a and b are 3d arrays.
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
25 c arguments:
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
26 c m,n,k (in) the dimensions of a and b
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
27 c a,b (in) double prec. input arrays of size (m,k,n)
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
28 c c (out) double prec. output array, size (m,n)
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
29 integer m,n,k,i,j,l
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
30 double precision a(m,k,n),b(m,k,n)
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
31 double precision c(m,n)
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
32
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
33 double precision ddot
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
34 external ddot
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
35
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
36
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
37 c quick return if possible.
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
38 if (m <= 0 .or. n <= 0) return
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
39
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
40 if (m == 1) then
9876
21d81d06b221 cache-aligned loop for rowwise dot
Jaroslav Hajek <highegg@gmail.com>
parents: 9874
diff changeset
41 c the column-major case.
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
42 do j = 1,n
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
43 c(1,j) = ddot(k,a(1,1,j),1,b(1,1,j),1)
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
44 end do
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
45 else
9876
21d81d06b221 cache-aligned loop for rowwise dot
Jaroslav Hajek <highegg@gmail.com>
parents: 9874
diff changeset
46 c We prefer performance here, because that's what we generally
21d81d06b221 cache-aligned loop for rowwise dot
Jaroslav Hajek <highegg@gmail.com>
parents: 9874
diff changeset
47 c do by default in reduction functions. Besides, the accuracy
21d81d06b221 cache-aligned loop for rowwise dot
Jaroslav Hajek <highegg@gmail.com>
parents: 9874
diff changeset
48 c of xDOT is questionable. Hence, do a cache-aligned nested loop.
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
49 do j = 1,n
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
50 do i = 1,m
9876
21d81d06b221 cache-aligned loop for rowwise dot
Jaroslav Hajek <highegg@gmail.com>
parents: 9874
diff changeset
51 c(i,j) = 0d0
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
52 end do
9876
21d81d06b221 cache-aligned loop for rowwise dot
Jaroslav Hajek <highegg@gmail.com>
parents: 9874
diff changeset
53 do l = 1,k
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
54 do i = 1,m
9876
21d81d06b221 cache-aligned loop for rowwise dot
Jaroslav Hajek <highegg@gmail.com>
parents: 9874
diff changeset
55 c(i,j) = c(i,j) + a(i,l,j)*b(i,l,j)
9874
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
56 end do
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
57 end do
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
58 end do
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
59 end if
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
60
90bc0cc4518f implement compiled dot and blkmm
Jaroslav Hajek <highegg@gmail.com>
parents:
diff changeset
61 end subroutine