Line data Source code
1 : #if 0
2 : ! This file is part of ELPA.
3 : !
4 : ! The ELPA library was originally created by the ELPA consortium,
5 : ! consisting of the following organizations:
6 : !
7 : ! - Max Planck Computing and Data Facility (MPCDF), formerly known as
8 : ! Rechenzentrum Garching der Max-Planck-Gesellschaft (RZG),
9 : ! - Bergische Universität Wuppertal, Lehrstuhl für angewandte
10 : ! Informatik,
11 : ! - Technische Universität München, Lehrstuhl für Informatik mit
12 : ! Schwerpunkt Wissenschaftliches Rechnen ,
13 : ! - Fritz-Haber-Institut, Berlin, Abt. Theorie,
14 : ! - Max-Plack-Institut für Mathematik in den Naturwissenschaften,
15 : ! Leipzig, Abt. Komplexe Strukutren in Biologie und Kognition,
16 : ! and
17 : ! - IBM Deutschland GmbH
18 : !
19 : ! This particular source code file contains additions, changes and
20 : ! enhancements authored by Intel Corporation which is not part of
21 : ! the ELPA consortium.
22 : !
23 : ! More information can be found here:
24 : ! http://elpa.mpcdf.mpg.de/
25 : !
26 : ! ELPA is free software: you can redistribute it and/or modify
27 : ! it under the terms of the version 3 of the license of the
28 : ! GNU Lesser General Public License as published by the Free
29 : ! Software Foundation.
30 : !
31 : ! ELPA is distributed in the hope that it will be useful,
32 : ! but WITHOUT ANY WARRANTY; without even the implied warranty of
33 : ! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
34 : ! GNU Lesser General Public License for more details.
35 : !
36 : ! You should have received a copy of the GNU Lesser General Public License
37 : ! along with ELPA. If not, see <http://www.gnu.org/licenses/>
38 : !
39 : ! ELPA reflects a substantial effort on the part of the original
40 : ! ELPA consortium, and we ask you to respect the spirit of the
41 : ! license that we chose: i.e., please contribute any changes you
42 : ! may have back to the original ELPA library distribution, and keep
43 : ! any derivatives of ELPA under the same license that we chose for
44 : ! the original distribution, the GNU Lesser General Public License.
45 : !
46 : ! Author: Andreas Marek, MPCDF
47 : #endif
48 768 : function solve_elpa2_evp_&
49 : &MATH_DATATYPE&
50 : &_wrapper_&
51 : &PRECISION&
52 768 : & (na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, mpi_comm_all, &
53 : #if REALCASE == 1
54 : THIS_REAL_ELPA_KERNEL_API, useQR, &
55 : #endif
56 : #if COMPLEXCASE == 1
57 : THIS_COMPLEX_ELPA_KERNEL_API, &
58 : #endif
59 : useGPU) result(success) bind(C,name="elpa_solve_evp_&
60 : &MATH_DATATYPE&
61 : &_2stage_&
62 : &PRECISION&
63 : &_precision")
64 : use, intrinsic :: iso_c_binding
65 : use elpa2
66 :
67 : implicit none
68 : integer(kind=c_int) :: success
69 : integer(kind=c_int), value, intent(in) :: na, nev, lda, ldq, nblk, matrixCols, mpi_comm_cols, mpi_comm_rows, &
70 : mpi_comm_all
71 : integer(kind=c_int), value, intent(in) :: useGPU
72 : #if REALCASE == 1
73 : integer(kind=c_int), value, intent(in) :: THIS_REAL_ELPA_KERNEL_API, useQR
74 : #endif
75 : #if COMPLEXCASE == 1
76 : integer(kind=c_int), value, intent(in) :: THIS_COMPLEX_ELPA_KERNEL_API
77 : #endif
78 :
79 : real(kind=C_DATATYPE_KIND) :: ev(1:na)
80 : #if REALCASE == 1
81 : #ifdef USE_ASSUMED_SIZE
82 : real(kind=C_DATATYPE_KIND) :: a(lda,*), q(ldq,*)
83 : #else
84 : real(kind=C_DATATYPE_KIND) :: a(1:lda,1:matrixCols), q(1:ldq,1:matrixCols)
85 : #endif
86 : #endif /* REALCASE */
87 :
88 : #if COMPLEXCASE == 1
89 : #ifdef USE_ASSUMED_SIZE
90 : complex(kind=C_DATATYPE_KIND) :: a(lda,*), q(ldq,*)
91 : #else
92 : complex(kind=C_DATATYPE_KIND) :: a(1:lda,1:matrixCols), q(1:ldq,1:matrixCols)
93 : #endif
94 : #endif /* COMPLEXCASE */
95 :
96 : logical :: successFortran, useQRFortran
97 :
98 : #if REALCASE == 1
99 384 : if (useQR .eq. 0) then
100 384 : useQRFortran =.false.
101 : else
102 0 : useQRFortran = .true.
103 : endif
104 : #endif
105 : successFortran = elpa_solve_evp_&
106 : &MATH_DATATYPE&
107 : &_2stage_&
108 : &PRECISION&
109 : & (na, nev, a, lda, ev, q, ldq, nblk, matrixCols, mpi_comm_rows, &
110 : mpi_comm_cols, mpi_comm_all, &
111 : #if REALCASE == 1
112 : THIS_REAL_ELPA_KERNEL_API, useQRFortran, &
113 : #endif
114 : #if COMPLEXCASE == 1
115 : THIS_COMPLEX_ELPA_KERNEL_API, &
116 : #endif
117 768 : useGPU == 1)
118 :
119 768 : if (successFortran) then
120 768 : success = 1
121 : else
122 0 : success = 0
123 : endif
124 :
125 768 : end function
126 :
|