1 ;;; Compiled by f2cl version:
2 ;;; ("f2cl1.l,v 2edcbd958861 2012/05/30 03:34:52 toy $"
3 ;;; "f2cl2.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
4 ;;; "f2cl3.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
5 ;;; "f2cl4.l,v 96616d88fb7e 2008/02/22 22:19:34 rtoy $"
6 ;;; "f2cl5.l,v 3fe93de3be82 2012/05/06 02:17:14 toy $"
7 ;;; "f2cl6.l,v 1d5cbacbb977 2008/08/24 00:56:27 rtoy $"
8 ;;; "macros.l,v 3fe93de3be82 2012/05/06 02:17:14 toy $")
10 ;;; Using Lisp CMU Common Lisp 20d (20D Unicode)
12 ;;; Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
13 ;;; (:coerce-assigns :as-needed) (:array-type ':array)
14 ;;; (:array-slicing t) (:declare-common nil)
15 ;;; (:float-format double-float))
20 (let* ((one 1.0) (zero 0.0))
21 (declare (type (double-float 1.0 1.0) one
)
22 (type (double-float 0.0 0.0) zero
)
24 (defun dgemm (transa transb m n k alpha a lda b ldb$ beta c ldc
)
25 (declare (type (array double-float
(*)) c b a
)
26 (type (double-float) beta alpha
)
27 (type (f2cl-lib:integer4
) ldc ldb$ lda k n m
)
28 (type (simple-string *) transb transa
))
29 (f2cl-lib:with-multi-array-data
30 ((transa character transa-%data% transa-%offset%
)
31 (transb character transb-%data% transb-%offset%
)
32 (a double-float a-%data% a-%offset%
)
33 (b double-float b-%data% b-%offset%
)
34 (c double-float c-%data% c-%offset%
))
35 (prog ((temp 0.0) (i 0) (info 0) (j 0) (l 0) (ncola 0) (nrowa 0)
36 (nrowb 0) (nota nil
) (notb nil
))
37 (declare (type (double-float) temp
)
38 (type (f2cl-lib:integer4
) i info j l ncola nrowa nrowb
)
39 (type f2cl-lib
:logical nota notb
))
40 (setf nota
(lsame transa
"N"))
41 (setf notb
(lsame transb
"N"))
56 ((and (not nota
) (not (lsame transa
"C")) (not (lsame transa
"T")))
58 ((and (not notb
) (not (lsame transb
"C")) (not (lsame transb
"T")))
66 ((< lda
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowa
)))
69 (max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 nrowb
)))
71 ((< ldc
(max (the f2cl-lib
:integer4
1) (the f2cl-lib
:integer4 m
)))
75 (xerbla "DGEMM " info
)
77 (if (or (= m
0) (= n
0) (and (or (= alpha zero
) (= k
0)) (= beta one
)))
83 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
86 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
89 (setf (f2cl-lib:fref c-%data%
97 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
100 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
103 (setf (f2cl-lib:fref c-%data%
108 (f2cl-lib:fref c-%data%
119 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
124 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
127 (setf (f2cl-lib:fref c-%data%
134 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
137 (setf (f2cl-lib:fref c-%data%
142 (f2cl-lib:fref c-%data%
147 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
151 ((/= (f2cl-lib:fref b
(l j
) ((1 ldb$
) (1 *))) zero
)
154 (f2cl-lib:fref b-%data%
158 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
161 (setf (f2cl-lib:fref c-%data%
166 (f2cl-lib:fref c-%data%
171 (f2cl-lib:fref a-%data%
179 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
182 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
186 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
192 (f2cl-lib:fref a-%data%
196 (f2cl-lib:fref b-%data%
203 (setf (f2cl-lib:fref c-%data%
209 (setf (f2cl-lib:fref c-%data%
215 (f2cl-lib:fref c-%data%
224 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
229 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
232 (setf (f2cl-lib:fref c-%data%
239 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
242 (setf (f2cl-lib:fref c-%data%
247 (f2cl-lib:fref c-%data%
252 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
256 ((/= (f2cl-lib:fref b
(j l
) ((1 ldb$
) (1 *))) zero
)
259 (f2cl-lib:fref b-%data%
263 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
266 (setf (f2cl-lib:fref c-%data%
271 (f2cl-lib:fref c-%data%
276 (f2cl-lib:fref a-%data%
284 (f2cl-lib:fdo
(j 1 (f2cl-lib:int-add j
1))
287 (f2cl-lib:fdo
(i 1 (f2cl-lib:int-add i
1))
291 (f2cl-lib:fdo
(l 1 (f2cl-lib:int-add l
1))
297 (f2cl-lib:fref a-%data%
301 (f2cl-lib:fref b-%data%
308 (setf (f2cl-lib:fref c-%data%
314 (setf (f2cl-lib:fref c-%data%
320 (f2cl-lib:fref c-%data%
329 (values nil nil nil nil nil nil nil nil nil nil nil nil nil
))))))
331 (in-package #:cl-user
)
332 #+#.
(cl:if
(cl:find-package
'#:f2cl
) '(and) '(or))
333 (eval-when (:load-toplevel
:compile-toplevel
:execute
)
334 (setf (gethash 'fortran-to-lisp
::dgemm fortran-to-lisp
::*f2cl-function-info
*)
335 (fortran-to-lisp::make-f2cl-finfo
336 :arg-types
'((simple-string) (simple-string)
337 (fortran-to-lisp::integer4
) (fortran-to-lisp::integer4
)
338 (fortran-to-lisp::integer4
) (double-float)
339 (array double-float
(*)) (fortran-to-lisp::integer4
)
340 (array double-float
(*)) (fortran-to-lisp::integer4
)
341 (double-float) (array double-float
(*))
342 (fortran-to-lisp::integer4
))
343 :return-values
'(nil nil nil nil nil nil nil nil nil nil nil nil
345 :calls
'(fortran-to-lisp::xerbla fortran-to-lisp
::lsame
))))