PLASMA  2.4.5
PLASMA - Parallel Linear Algebra for Scalable Multi-core Architectures
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups
plasma_cf90_wrappers.F90
Go to the documentation of this file.
1 !
2 ! Copyright © 2011 The Numerical Algorithms Group Ltd. All rights reserved.
3 !
4 ! Redistribution and use in source and binary forms, with or without
5 ! modification, are permitted provided that the following conditions are
6 ! met:
7 ! - Redistributions of source code must retain the above copyright notice,
8 ! this list of conditions, and the following disclaimer.
9 ! - Redistributions in binary form must reproduce the above copyright
10 ! notice, this list of conditions and the following disclaimer listed in
11 ! this license in the documentation and/or other materials provided with
12 ! the distribution.
13 ! - Neither the name of the copyright holders nor the names of its
14 ! contributors may be used to endorse or promote products derived from
15 ! this software without specific prior written permission.
16 !
17 ! This software is provided by the copyright holders and contributors "as
18 ! is" and any express or implied warranties, including, but not limited
19 ! to, the implied warranties of merchantability and fitness for a
20 ! particular purpose are disclaimed. in no event shall the copyright owner
21 ! or contributors be liable for any direct, indirect, incidental, special,
22 ! exemplary, or consequential damages (including, but not limited to,
23 ! procurement of substitute goods or services; loss of use, data, or
24 ! profits; or business interruption) however caused and on any theory of
25 ! liability, whether in contract, strict liability, or tort (including
26 ! negligence or otherwise) arising in any way out of the use of this
27 ! software, even if advised of the possibility of such damage.
28 !
29 !
30 !
31 ! @file plasma_cf90_wrappers.F90
32 !
33 ! PLASMA fortran wrapper for BLAS and LAPACK subroutines.
34 ! PLASMA is a software package provided by Univ. of Tennessee,
35 ! Univ. of California Berkeley and Univ. of Colorado Denver
36 !
37 ! @version 2.4.2
38 ! @author Numerical Algorithm Group
39 ! @author Mathieu Faverge
40 ! @date 2011-09-15
41 ! @generated c Tue Nov 22 14:35:45 2011
42 !
43 !
44 ! Wrappers to PLASMA functions are provided for the following BLAS
45 ! subroutines since the PLASMA and BLAS interfaces match exactly:
46 ! CGEMM PLASMA_cgemm
47 ! CHEMM PLASMA_chemm
48 ! CHER2K PLASMA_cher2k
49 ! CHERK PLASMA_cherk
50 ! CSYMM PLASMA_csymm
51 ! CSYR2K PLASMA_csyr2k
52 ! CSYRK PLASMA_csyrk
53 ! CTRMM PLASMA_ctrmm
54 ! CTRSM PLASMA_ctrsm
55 !
56 ! Wrappers to PLASMA functions are provided for the following LAPACK
57 ! subroutines since the PLASMA and LAPACK interfaces match exactly:
58 ! CGESV PLASMA_cgesv
59 ! CGETRF PLASMA_cgetrf
60 ! CGETRS PLASMA_cgetrs
61 ! CHEGST PLASMA_chegst
62 ! CLASWP PLASMA_claswp
63 ! CLAUUM PLASMA_clauum
64 ! CPOSV PLASMA_cposv
65 ! CPOTRF PLASMA_cpotrf
66 ! CPOTRI PLASMA_cpotri
67 ! CPOTRS PLASMA_cpotrs
68 ! CTRTRI PLASMA_ctrtri
69 #define PRECISION_c
70 
71  subroutine plasma_wrap_cgesv(N,NRHS,A,LDA,IPIV,B,LDB,INFO)
72  use iso_c_binding
73  use plasma
74  implicit none
75  integer, parameter :: wp = kind(0.0d0)
76  integer, intent(in) :: lda
77  integer, intent(in) :: ldb
78  integer, intent(in) :: n
79  integer, intent(in) :: nrhs
80  integer, intent(out) :: info
81  integer, intent(out), target :: ipiv(*)
82  complex, intent(inout), target :: a(lda,*)
83  complex, intent(inout), target :: b(ldb,*)
84  if (.not. plasma_initialized) call plasma_init(24,info)
85  ! write(*,*) " Calling PLASMA_CGESV"
86  call plasma_cgesv(n,nrhs,a,lda,ipiv,b,ldb,info)
87  end subroutine plasma_wrap_cgesv
88 
89  subroutine plasma_wrap_cgetrf(M,N,A,LDA,IPIV,INFO)
90  use iso_c_binding
91  use plasma
92  implicit none
93  integer, parameter :: wp = kind(0.0d0)
94  integer, intent(in) :: lda
95  integer, intent(in) :: m
96  integer, intent(in) :: n
97  integer, intent(out) :: info
98  integer, intent(out), target :: ipiv(*)
99  complex, intent(inout), target :: a(lda,*)
100  if (.not. plasma_initialized) call plasma_init(24,info)
101  ! write(*,*) " Calling PLASMA_CGETRF"
102  call plasma_cgetrf(m,n,a,lda,ipiv,info)
103  end subroutine plasma_wrap_cgetrf
104 
105  subroutine plasma_wrap_cgetrs(TRANS,N,NRHS,A,LDA,IPIV,B,LDB,INFO)
106  use iso_c_binding
107  use plasma
108  implicit none
109  integer, parameter :: wp = kind(0.0d0)
110  integer, intent(in) :: lda
111  integer, intent(in) :: ldb
112  integer, intent(in) :: n
113  integer, intent(in) :: nrhs
114  integer, intent(in), target :: ipiv(*)
115  integer, intent(out) :: info
116  character, intent(in) :: trans
117  complex, intent(in), target :: a(lda,*)
118  complex, intent(inout), target :: b(ldb,*)
119  integer :: local_trans
120  if(trans=='N' .or. trans=='n')then
121  local_trans = plasmanotrans
122  else if(trans=='T' .or. trans=='t')then
123  local_trans = plasmatrans
124  else if(trans=='C' .or. trans=='c')then
125  local_trans = plasmaconjtrans
126  else
127  local_trans = -1
128  end if
129  if (.not. plasma_initialized) call plasma_init(24,info)
130  ! write(*,*) " Calling PLASMA_CGETRS"
131  call plasma_cgetrs(local_trans,n,nrhs,a,lda,ipiv,b,ldb,info)
132  end subroutine plasma_wrap_cgetrs
133 
134  subroutine plasma_wrap_chegst(ITYPE,UPLO,N,A,LDA,B,LDB,INFO)
135  use iso_c_binding
136  use plasma
137  implicit none
138  integer, parameter :: wp = kind(0.0d0)
139  integer, intent(in) :: itype
140  integer, intent(in) :: lda
141  integer, intent(in) :: ldb
142  integer, intent(in) :: n
143  integer, intent(out) :: info
144  character, intent(in) :: uplo
145  complex, intent(in), target :: b(ldb,*)
146  complex, intent(inout), target :: a(lda,*)
147  integer :: local_uplo
148  if(uplo=='U' .or. uplo=='u')then
149  local_uplo = plasmaupper
150  else if(uplo=='L' .or. uplo=='l')then
151  local_uplo = plasmalower
152  else
153  local_uplo = -1
154  end if
155  if (.not. plasma_initialized) call plasma_init(24,info)
156  ! write(*,*) " Calling PLASMA_CHEGST"
157  call plasma_chegst(itype,local_uplo,n,a,lda,b,ldb,info)
158  end subroutine plasma_wrap_chegst
159 
160  subroutine plasma_wrap_claswp(N,A,LDA,K1,K2,IPIV,INCX)
161  use iso_c_binding
162  use plasma
163  implicit none
164  integer, parameter :: wp = kind(0.0d0)
165  integer, intent(in) :: incx
166  integer, intent(in) :: k1
167  integer, intent(in) :: k2
168  integer, intent(in) :: lda
169  integer, intent(in) :: n
170  integer, intent(in), target :: ipiv(*)
171  complex, intent(inout), target :: a(lda,*)
172  integer :: local_ret
173  if (.not. plasma_initialized) call plasma_init(24,local_ret)
174  ! write(*,*) " Calling PLASMA_CLASWP"
175  call plasma_claswp(n,a,lda,k1,k2,ipiv,incx,local_ret)
176  end subroutine plasma_wrap_claswp
177 
178  subroutine plasma_wrap_clauum(UPLO,N,A,LDA,INFO)
179  use iso_c_binding
180  use plasma
181  implicit none
182  integer, parameter :: wp = kind(0.0d0)
183  integer, intent(in) :: lda
184  integer, intent(in) :: n
185  integer, intent(out) :: info
186  character, intent(in) :: uplo
187  complex, intent(inout), target :: a(lda,*)
188  integer :: local_uplo
189  if(uplo=='U' .or. uplo=='u')then
190  local_uplo = plasmaupper
191  else if(uplo=='L' .or. uplo=='l')then
192  local_uplo = plasmalower
193  else
194  local_uplo = -1
195  end if
196  if (.not. plasma_initialized) call plasma_init(24,info)
197  ! write(*,*) " Calling PLASMA_CLAUUM"
198  call plasma_clauum(local_uplo,n,a,lda,info)
199  end subroutine plasma_wrap_clauum
200 
201  subroutine plasma_wrap_cposv(UPLO,N,NRHS,A,LDA,B,LDB,INFO)
202  use iso_c_binding
203  use plasma
204  implicit none
205  integer, parameter :: wp = kind(0.0d0)
206  integer, intent(in) :: lda
207  integer, intent(in) :: ldb
208  integer, intent(in) :: n
209  integer, intent(in) :: nrhs
210  integer, intent(out) :: info
211  character, intent(in) :: uplo
212  complex, intent(inout), target :: a(lda,*)
213  complex, intent(inout), target :: b(ldb,*)
214  integer :: local_uplo
215  if(uplo=='U' .or. uplo=='u')then
216  local_uplo = plasmaupper
217  else if(uplo=='L' .or. uplo=='l')then
218  local_uplo = plasmalower
219  else
220  local_uplo = -1
221  end if
222  if (.not. plasma_initialized) call plasma_init(24,info)
223  ! write(*,*) " Calling PLASMA_CPOSV"
224  call plasma_cposv(local_uplo,n,nrhs,a,lda,b,ldb,info)
225  end subroutine plasma_wrap_cposv
226 
227  subroutine plasma_wrap_cpotrf(UPLO,N,A,LDA,INFO)
228  use iso_c_binding
229  use plasma
230  implicit none
231  integer, parameter :: wp = kind(0.0d0)
232  integer, intent(in) :: lda
233  integer, intent(in) :: n
234  integer, intent(out) :: info
235  character, intent(in) :: uplo
236  complex, intent(inout), target :: a(lda,*)
237  integer :: local_uplo
238  if(uplo=='U' .or. uplo=='u')then
239  local_uplo = plasmaupper
240  else if(uplo=='L' .or. uplo=='l')then
241  local_uplo = plasmalower
242  else
243  local_uplo = -1
244  end if
245  if (.not. plasma_initialized) call plasma_init(24,info)
246  ! write(*,*) " Calling PLASMA_CPOTRF"
247  call plasma_cpotrf(local_uplo,n,a,lda,info)
248  end subroutine plasma_wrap_cpotrf
249 
250  subroutine plasma_wrap_cpotri(UPLO,N,A,LDA,INFO)
251  use iso_c_binding
252  use plasma
253  implicit none
254  integer, parameter :: wp = kind(0.0d0)
255  integer, intent(in) :: lda
256  integer, intent(in) :: n
257  integer, intent(out) :: info
258  character, intent(in) :: uplo
259  complex, intent(inout), target :: a(lda,*)
260  integer :: local_uplo
261  if(uplo=='U' .or. uplo=='u')then
262  local_uplo = plasmaupper
263  else if(uplo=='L' .or. uplo=='l')then
264  local_uplo = plasmalower
265  else
266  local_uplo = -1
267  end if
268  if (.not. plasma_initialized) call plasma_init(24,info)
269  ! write(*,*) " Calling PLASMA_CPOTRI"
270  call plasma_cpotri(local_uplo,n,a,lda,info)
271  end subroutine plasma_wrap_cpotri
272 
273  subroutine plasma_wrap_cpotrs(UPLO,N,NRHS,A,LDA,B,LDB,INFO)
274  use iso_c_binding
275  use plasma
276  implicit none
277  integer, parameter :: wp = kind(0.0d0)
278  integer, intent(in) :: lda
279  integer, intent(in) :: ldb
280  integer, intent(in) :: n
281  integer, intent(in) :: nrhs
282  integer, intent(out) :: info
283  character, intent(in) :: uplo
284  complex, intent(in), target :: a(lda,*)
285  complex, intent(inout), target :: b(ldb,*)
286  integer :: local_uplo
287  if(uplo=='U' .or. uplo=='u')then
288  local_uplo = plasmaupper
289  else if(uplo=='L' .or. uplo=='l')then
290  local_uplo = plasmalower
291  else
292  local_uplo = -1
293  end if
294  if (.not. plasma_initialized) call plasma_init(24,info)
295  ! write(*,*) " Calling PLASMA_CPOTRS"
296  call plasma_cpotrs(local_uplo,n,nrhs,a,lda,b,ldb,info)
297  end subroutine plasma_wrap_cpotrs
298 
299  subroutine plasma_wrap_ctrtri(UPLO,DIAG,N,A,LDA,INFO)
300  use iso_c_binding
301  use plasma
302  implicit none
303  integer, parameter :: wp = kind(0.0d0)
304  integer, intent(in) :: lda
305  integer, intent(in) :: n
306  integer, intent(out) :: info
307  character, intent(in) :: diag
308  character, intent(in) :: uplo
309  complex, intent(inout), target :: a(lda,*)
310  integer :: local_diag
311  integer :: local_uplo
312  if(uplo=='U' .or. uplo=='u')then
313  local_uplo = plasmaupper
314  else if(uplo=='L' .or. uplo=='l')then
315  local_uplo = plasmalower
316  else
317  local_uplo = -1
318  end if
319  if(diag=='U' .or. diag=='u')then
320  local_diag = plasmaunit
321  else if(diag=='N' .or. diag=='n')then
322  local_diag = plasmanonunit
323  else
324  local_diag = -1
325  end if
326  if (.not. plasma_initialized) call plasma_init(24,info)
327  ! write(*,*) " Calling PLASMA_CTRTRI"
328  call plasma_ctrtri(local_uplo,local_diag,n,a,lda,info)
329  end subroutine plasma_wrap_ctrtri
330 
331  subroutine plasma_wrap_cgemm(TRANSA,TRANSB,M,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
332  use iso_c_binding
333  use plasma
334  implicit none
335  integer, parameter :: wp = kind(0.0d0)
336  integer, intent(in) :: k
337  integer, intent(in) :: lda
338  integer, intent(in) :: ldb
339  integer, intent(in) :: ldc
340  integer, intent(in) :: m
341  integer, intent(in) :: n
342  character, intent(in) :: transa
343  character, intent(in) :: transb
344  complex, intent(in) :: alpha
345  complex, intent(in) :: beta
346  complex, intent(in), target :: a(lda,*)
347  complex, intent(in), target :: b(ldb,*)
348  complex, intent(inout), target :: c(ldc,*)
349  integer :: local_transa
350  integer :: local_transb
351  integer :: local_ret
352  if(transa=='N' .or. transa=='n')then
353  local_transa = plasmanotrans
354  else if(transa=='T' .or. transa=='t')then
355  local_transa = plasmatrans
356  else if(transa=='C' .or. transa=='c')then
357  local_transa = plasmaconjtrans
358  else
359  local_transa = -1
360  end if
361  if(transb=='N' .or. transb=='n')then
362  local_transb = plasmanotrans
363  else if(transb=='T' .or. transb=='t')then
364  local_transb = plasmatrans
365  else if(transb=='C' .or. transb=='c')then
366  local_transb = plasmaconjtrans
367  else
368  local_transb = -1
369  end if
370  if (.not. plasma_initialized) call plasma_init(24,local_ret)
371  ! write(*,*) " Calling PLASMA_CGEMM"
372  call plasma_cgemm(local_transa,local_transb,m,n,k,alpha,a,lda,b,ldb,beta,c,ldc,local_ret)
373  end subroutine plasma_wrap_cgemm
374 
375 #if defined(PRECISION_z) || defined(PRECISION_c)
376  subroutine plasma_wrap_chemm(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
377  use iso_c_binding
378  use plasma
379  implicit none
380  integer, parameter :: wp = kind(0.0d0)
381  integer, intent(in) :: lda
382  integer, intent(in) :: ldb
383  integer, intent(in) :: ldc
384  integer, intent(in) :: m
385  integer, intent(in) :: n
386  character, intent(in) :: side
387  character, intent(in) :: uplo
388  complex, intent(in) :: alpha
389  complex, intent(in) :: beta
390  complex, intent(in), target :: a(lda,*)
391  complex, intent(in), target :: b(ldb,*)
392  complex, intent(inout), target :: c(ldc,*)
393  integer :: local_side
394  integer :: local_uplo
395  integer :: local_ret
396  if(side=='L' .or. side=='l')then
397  local_side = plasmaleft
398  else if(side=='R' .or. side=='r')then
399  local_side = plasmaright
400  else
401  local_side = -1
402  end if
403  if(uplo=='U' .or. uplo=='u')then
404  local_uplo = plasmaupper
405  else if(uplo=='L' .or. uplo=='l')then
406  local_uplo = plasmalower
407  else
408  local_uplo = -1
409  end if
410  if (.not. plasma_initialized) call plasma_init(24,local_ret)
411  ! write(*,*) " Calling PLASMA_CHEMM"
412  call plasma_chemm(local_side,local_uplo,m,n,alpha,a,lda,b,ldb,beta,c,ldc,local_ret)
413  end subroutine plasma_wrap_chemm
414 
415  subroutine plasma_wrap_cher2k(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
416  use iso_c_binding
417  use plasma
418  implicit none
419  integer, parameter :: wp = kind(0.0d0)
420  integer, intent(in) :: k
421  integer, intent(in) :: lda
422  integer, intent(in) :: ldb
423  integer, intent(in) :: ldc
424  integer, intent(in) :: n
425  character, intent(in) :: trans
426  character, intent(in) :: uplo
427  complex, intent(in) :: alpha
428  complex, intent(in), target :: a(lda,*)
429  complex, intent(in), target :: b(ldb,*)
430  complex, intent(inout), target :: c(ldc,*)
431  real, intent(in) :: beta
432  integer :: local_trans
433  integer :: local_uplo
434  integer :: local_ret
435  if(uplo=='U' .or. uplo=='u')then
436  local_uplo = plasmaupper
437  else if(uplo=='L' .or. uplo=='l')then
438  local_uplo = plasmalower
439  else
440  local_uplo = -1
441  end if
442  if(trans=='N' .or. trans=='n')then
443  local_trans = plasmanotrans
444  else if(trans=='T' .or. trans=='t')then
445  local_trans = plasmatrans
446  else if(trans=='C' .or. trans=='c')then
447  local_trans = plasmaconjtrans
448  else
449  local_trans = -1
450  end if
451  if (.not. plasma_initialized) call plasma_init(24,local_ret)
452  ! write(*,*) " Calling PLASMA_CHER2K"
453  call plasma_cher2k(local_uplo,local_trans,n,k,alpha,a,lda,b,ldb,beta,c,ldc,local_ret)
454  end subroutine plasma_wrap_cher2k
455 
456  subroutine plasma_wrap_cherk(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)
457  use iso_c_binding
458  use plasma
459  implicit none
460  integer, parameter :: wp = kind(0.0d0)
461  integer, intent(in) :: k
462  integer, intent(in) :: lda
463  integer, intent(in) :: ldc
464  integer, intent(in) :: n
465  character, intent(in) :: trans
466  character, intent(in) :: uplo
467  complex, intent(in), target :: a(lda,*)
468  complex, intent(inout), target :: c(ldc,*)
469  real, intent(in) :: alpha
470  real, intent(in) :: beta
471  integer :: local_trans
472  integer :: local_uplo
473  integer :: local_ret
474  if(uplo=='U' .or. uplo=='u')then
475  local_uplo = plasmaupper
476  else if(uplo=='L' .or. uplo=='l')then
477  local_uplo = plasmalower
478  else
479  local_uplo = -1
480  end if
481  if(trans=='N' .or. trans=='n')then
482  local_trans = plasmanotrans
483  else if(trans=='T' .or. trans=='t')then
484  local_trans = plasmatrans
485  else if(trans=='C' .or. trans=='c')then
486  local_trans = plasmaconjtrans
487  else
488  local_trans = -1
489  end if
490  if (.not. plasma_initialized) call plasma_init(24,local_ret)
491  ! write(*,*) " Calling PLASMA_CHERK"
492  call plasma_cherk(local_uplo,local_trans,n,k,alpha,a,lda,beta,c,ldc,local_ret)
493  end subroutine plasma_wrap_cherk
494 #endif
495 
496  subroutine plasma_wrap_csymm(SIDE,UPLO,M,N,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
497  use iso_c_binding
498  use plasma
499  implicit none
500  integer, parameter :: wp = kind(0.0d0)
501  integer, intent(in) :: lda
502  integer, intent(in) :: ldb
503  integer, intent(in) :: ldc
504  integer, intent(in) :: m
505  integer, intent(in) :: n
506  character, intent(in) :: side
507  character, intent(in) :: uplo
508  complex, intent(in) :: alpha
509  complex, intent(in) :: beta
510  complex, intent(in), target :: a(lda,*)
511  complex, intent(in), target :: b(ldb,*)
512  complex, intent(inout), target :: c(ldc,*)
513  integer :: local_side
514  integer :: local_uplo
515  integer :: local_ret
516  if(side=='L' .or. side=='l')then
517  local_side = plasmaleft
518  else if(side=='R' .or. side=='r')then
519  local_side = plasmaright
520  else
521  local_side = -1
522  end if
523  if(uplo=='U' .or. uplo=='u')then
524  local_uplo = plasmaupper
525  else if(uplo=='L' .or. uplo=='l')then
526  local_uplo = plasmalower
527  else
528  local_uplo = -1
529  end if
530  if (.not. plasma_initialized) call plasma_init(24,local_ret)
531  ! write(*,*) " Calling PLASMA_CSYMM"
532  call plasma_csymm(local_side,local_uplo,m,n,alpha,a,lda,b,ldb,beta,c,ldc,local_ret)
533  end subroutine plasma_wrap_csymm
534 
535  subroutine plasma_wrap_csyr2k(UPLO,TRANS,N,K,ALPHA,A,LDA,B,LDB,BETA,C,LDC)
536  use iso_c_binding
537  use plasma
538  implicit none
539  integer, parameter :: wp = kind(0.0d0)
540  integer, intent(in) :: k
541  integer, intent(in) :: lda
542  integer, intent(in) :: ldb
543  integer, intent(in) :: ldc
544  integer, intent(in) :: n
545  character, intent(in) :: trans
546  character, intent(in) :: uplo
547  complex, intent(in) :: alpha
548  complex, intent(in) :: beta
549  complex, intent(in), target :: a(lda,*)
550  complex, intent(in), target :: b(ldb,*)
551  complex, intent(inout), target :: c(ldc,*)
552  integer :: local_trans
553  integer :: local_uplo
554  integer :: local_ret
555  if(uplo=='U' .or. uplo=='u')then
556  local_uplo = plasmaupper
557  else if(uplo=='L' .or. uplo=='l')then
558  local_uplo = plasmalower
559  else
560  local_uplo = -1
561  end if
562  if(trans=='N' .or. trans=='n')then
563  local_trans = plasmanotrans
564  else if(trans=='T' .or. trans=='t')then
565  local_trans = plasmatrans
566  else if(trans=='C' .or. trans=='c')then
567  local_trans = plasmaconjtrans
568  else
569  local_trans = -1
570  end if
571  if (.not. plasma_initialized) call plasma_init(24,local_ret)
572  ! write(*,*) " Calling PLASMA_CSYR2K"
573  call plasma_csyr2k(local_uplo,local_trans,n,k,alpha,a,lda,b,ldb,beta,c,ldc,local_ret)
574  end subroutine plasma_wrap_csyr2k
575 
576  subroutine plasma_wrap_csyrk(UPLO,TRANS,N,K,ALPHA,A,LDA,BETA,C,LDC)
577  use iso_c_binding
578  use plasma
579  implicit none
580  integer, parameter :: wp = kind(0.0d0)
581  integer, intent(in) :: k
582  integer, intent(in) :: lda
583  integer, intent(in) :: ldc
584  integer, intent(in) :: n
585  character, intent(in) :: trans
586  character, intent(in) :: uplo
587  complex, intent(in) :: alpha
588  complex, intent(in) :: beta
589  complex, intent(in), target :: a(lda,*)
590  complex, intent(inout), target :: c(ldc,*)
591  integer :: local_trans
592  integer :: local_uplo
593  integer :: local_ret
594  if(uplo=='U' .or. uplo=='u')then
595  local_uplo = plasmaupper
596  else if(uplo=='L' .or. uplo=='l')then
597  local_uplo = plasmalower
598  else
599  local_uplo = -1
600  end if
601  if(trans=='N' .or. trans=='n')then
602  local_trans = plasmanotrans
603  else if(trans=='T' .or. trans=='t')then
604  local_trans = plasmatrans
605  else if(trans=='C' .or. trans=='c')then
606  local_trans = plasmaconjtrans
607  else
608  local_trans = -1
609  end if
610  if (.not. plasma_initialized) call plasma_init(24,local_ret)
611  ! write(*,*) " Calling PLASMA_CSYRK"
612  call plasma_csyrk(local_uplo,local_trans,n,k,alpha,a,lda,beta,c,ldc,local_ret)
613  end subroutine plasma_wrap_csyrk
614 
615  subroutine plasma_wrap_ctrmm(SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB)
616  use iso_c_binding
617  use plasma
618  implicit none
619  integer, parameter :: wp = kind(0.0d0)
620  integer, intent(in) :: lda
621  integer, intent(in) :: ldb
622  integer, intent(in) :: m
623  integer, intent(in) :: n
624  character, intent(in) :: diag
625  character, intent(in) :: side
626  character, intent(in) :: transa
627  character, intent(in) :: uplo
628  complex, intent(in) :: alpha
629  complex, intent(in), target :: a(lda,*)
630  complex, intent(inout), target :: b(ldb,*)
631  integer :: local_diag
632  integer :: local_side
633  integer :: local_transa
634  integer :: local_uplo
635  integer :: local_ret
636  if(side=='L' .or. side=='l')then
637  local_side = plasmaleft
638  else if(side=='R' .or. side=='r')then
639  local_side = plasmaright
640  else
641  local_side = -1
642  end if
643  if(uplo=='U' .or. uplo=='u')then
644  local_uplo = plasmaupper
645  else if(uplo=='L' .or. uplo=='l')then
646  local_uplo = plasmalower
647  else
648  local_uplo = -1
649  end if
650  if(transa=='N' .or. transa=='n')then
651  local_transa = plasmanotrans
652  else if(transa=='T' .or. transa=='t')then
653  local_transa = plasmatrans
654  else if(transa=='C' .or. transa=='c')then
655  local_transa = plasmaconjtrans
656  else
657  local_transa = -1
658  end if
659  if(diag=='U' .or. diag=='u')then
660  local_diag = plasmaunit
661  else if(diag=='N' .or. diag=='n')then
662  local_diag = plasmanonunit
663  else
664  local_diag = -1
665  end if
666  if (.not. plasma_initialized) call plasma_init(24,local_ret)
667  ! write(*,*) " Calling PLASMA_CTRMM"
668  call plasma_ctrmm(local_side,local_uplo,local_transa,local_diag,m,n,alpha,a,lda,b,ldb,local_ret)
669  end subroutine plasma_wrap_ctrmm
670 
671  subroutine plasma_wrap_ctrsm(SIDE,UPLO,TRANSA,DIAG,M,N,ALPHA,A,LDA,B,LDB)
672  use iso_c_binding
673  use plasma
674  implicit none
675  integer, parameter :: wp = kind(0.0d0)
676  integer, intent(in) :: lda
677  integer, intent(in) :: ldb
678  integer, intent(in) :: m
679  integer, intent(in) :: n
680  character, intent(in) :: diag
681  character, intent(in) :: side
682  character, intent(in) :: transa
683  character, intent(in) :: uplo
684  complex, intent(in) :: alpha
685  complex, intent(in), target :: a(lda,*)
686  complex, intent(inout), target :: b(ldb,*)
687  integer :: local_diag
688  integer :: local_side
689  integer :: local_transa
690  integer :: local_uplo
691  integer :: local_ret
692  if(side=='L' .or. side=='l')then
693  local_side = plasmaleft
694  else if(side=='R' .or. side=='r')then
695  local_side = plasmaright
696  else
697  local_side = -1
698  end if
699  if(uplo=='U' .or. uplo=='u')then
700  local_uplo = plasmaupper
701  else if(uplo=='L' .or. uplo=='l')then
702  local_uplo = plasmalower
703  else
704  local_uplo = -1
705  end if
706  if(transa=='N' .or. transa=='n')then
707  local_transa = plasmanotrans
708  else if(transa=='T' .or. transa=='t')then
709  local_transa = plasmatrans
710  else if(transa=='C' .or. transa=='c')then
711  local_transa = plasmaconjtrans
712  else
713  local_transa = -1
714  end if
715  if(diag=='U' .or. diag=='u')then
716  local_diag = plasmaunit
717  else if(diag=='N' .or. diag=='n')then
718  local_diag = plasmanonunit
719  else
720  local_diag = -1
721  end if
722  if (.not. plasma_initialized) call plasma_init(24,local_ret)
723  ! write(*,*) " Calling PLASMA_CTRSM"
724  call plasma_ctrsm(local_side,local_uplo,local_transa,local_diag,m,n,alpha,a,lda,b,ldb,local_ret)
725  end subroutine plasma_wrap_ctrsm