Commit c732662c authored by Andreas Marek's avatar Andreas Marek

Template for elpa_invert_trm C-interface

parent aa28e66d
......@@ -59,6 +59,7 @@ EXTRA_libelpa@SUFFIX@_private_la_DEPENDENCIES = \
src/elpa_solve_tridi_c_interface_template.X90 \
src/elpa_mult_at_b_c_interface_template.X90 \
src/elpa_mult_ah_b_c_interface_template.X90 \
src/elpa_invert_trm_c_interface_template.X90 \
src/elpa2_bandred_template.X90 \
src/elpa2_symm_matrix_allreduce_real_template.X90 \
src/elpa2_trans_ev_band_to_full_template.X90 \
......@@ -985,6 +986,7 @@ EXTRA_DIST = \
src/elpa_solve_tridi_c_interface_template.X90 \
src/elpa_mult_at_b_c_interface_template.X90 \
src/elpa_mult_ah_b_c_interface_template.X90 \
src/elpa_invert_trm_c_interface_template.X90 \
src/elpa2_tridiag_band_template.X90 \
src/elpa2_trans_ev_band_to_full_template.X90 \
src/elpa2_trans_ev_tridi_to_band_template.X90 \
......
......@@ -883,38 +883,12 @@
!c> */
!c> int elpa_invert_trm_real_double(int na, double *a, int lda, int nblk, int matrixCols, int mpi_comm_rows, int mpi_comm_cols, int wantDebug);
function elpa_invert_trm_real_wrapper_double(na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebug) &
result(success) bind(C,name="elpa_invert_trm_real_double")
use, intrinsic :: iso_c_binding
use elpa1_auxiliary, only : elpa_invert_trm_real_double
implicit none
integer(kind=c_int), value :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
integer(kind=c_int), value :: wantDebug
integer(kind=c_int) :: success
#ifdef USE_ASSUMED_SIZE
real(kind=c_double) :: a(lda,*)
#else
real(kind=c_double) :: a(lda,matrixCols)
#endif
logical :: wantDebugFortran, successFortran
if (wantDebug .ne. 0) then
wantDebugFortran = .true.
else
wantDebugFortran = .false.
endif
successFortran = elpa_invert_trm_real_double(na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebugFortran)
if (successFortran) then
success = 1
else
success = 0
endif
end function
#define REALCASE 1
#define DOUBLE_PRECISION 1
#include "precision_macros.h"
#include "elpa_invert_trm_c_interface_template.X90"
#undef DOUBLE_PRECISION
#undef REALCASE
#ifdef WANT_SINGLE_PRECISION_REAL
......@@ -936,35 +910,13 @@
!c> */
!c> int elpa_invert_trm_real_single(int na, double *a, int lda, int nblk, int matrixCols, int mpi_comm_rows, int mpi_comm_cols, int wantDebug);
function elpa_invert_trm_real_wrapper_single(na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebug) &
result(success) bind(C,name="elpa_invert_trm_real_single")
use, intrinsic :: iso_c_binding
use elpa1_auxiliary, only : elpa_invert_trm_real_single
implicit none
integer(kind=c_int), value :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
integer(kind=c_int), value :: wantDebug
integer(kind=c_int) :: success
real(kind=c_float) :: a(lda,matrixCols)
logical :: wantDebugFortran, successFortran
if (wantDebug .ne. 0) then
wantDebugFortran = .true.
else
wantDebugFortran = .false.
endif
successFortran = elpa_invert_trm_real_single(na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebugFortran)
if (successFortran) then
success = 1
else
success = 0
endif
end function
#define REALCASE 1
#define SINGLE_PRECISION 1
#include "precision_macros.h"
#include "elpa_invert_trm_c_interface_template.X90"
#undef SINGLE_PRECISION
#undef REALCASE
#endif /* WANT_SINGLE_PRECISION_REAL */
......@@ -986,41 +938,12 @@
!c> */
!c> int elpa_invert_trm_complex_double(int na, double complex *a, int lda, int nblk, int matrixCols, int mpi_comm_rows, int mpi_comm_cols, int wantDebug);
function elpa_invert_trm_complex_wrapper_double(na, a, lda, nblk, matrixCols, mpi_comm_rows, &
mpi_comm_cols, wantDebug) result(success) &
bind(C,name="elpa_invert_trm_complex_double")
use, intrinsic :: iso_c_binding
use elpa1_auxiliary, only : elpa_invert_trm_complex_double
implicit none
integer(kind=c_int), value :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
integer(kind=c_int), value :: wantDebug
integer(kind=c_int) :: success
#ifdef USE_ASSUMED_SIZE
complex(kind=c_double_complex) :: a(lda, *)
#else
complex(kind=c_double_complex) :: a(lda, matrixCols)
#endif
logical :: successFortran, wantDebugFortran
if (wantDebug .ne. 0) then
wantDebugFortran = .true.
else
wantDebugFortran = .false.
endif
successFortran = elpa_invert_trm_complex_double(na, a, lda, nblk, matrixCols, mpi_comm_rows, &
mpi_comm_cols, wantDebugFortran)
if (successFortran) then
success = 1
else
success = 0
endif
end function
#define COMPLEXCASE 1
#define DOUBLE_PRECISION 1
#include "precision_macros.h"
#include "elpa_invert_trm_c_interface_template.X90"
#undef DOUBLE_PRECISION
#undef COMPLEXCASE
#ifdef WANT_SINGLE_PRECISION_COMPLEX
!c> /*
......@@ -1041,37 +964,13 @@
!c> */
!c> int elpa_invert_trm_complex_single(int na, complex *a, int lda, int nblk, int matrixCols, int mpi_comm_rows, int mpi_comm_cols, int wantDebug);
function elpa_invert_trm_complex_wrapper_single(na, a, lda, nblk, matrixCols, mpi_comm_rows, &
mpi_comm_cols, wantDebug) result(success) &
bind(C,name="elpa_invert_trm_complex_single")
use, intrinsic :: iso_c_binding
use elpa1_auxiliary, only : elpa_invert_trm_complex_single
implicit none
integer(kind=c_int), value :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
integer(kind=c_int), value :: wantDebug
integer(kind=c_int) :: success
complex(kind=c_float_complex) :: a(lda, matrixCols)
logical :: successFortran, wantDebugFortran
if (wantDebug .ne. 0) then
wantDebugFortran = .true.
else
wantDebugFortran = .false.
endif
successFortran = elpa_invert_trm_complex_single(na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebugFortran)
#define COMPLEXCASE 1
#define SINGLE_PRECISION 1
#include "precision_macros.h"
#include "elpa_invert_trm_c_interface_template.X90"
#undef SINGLE_PRECISION
#undef COMPLEXCASE
if (successFortran) then
success = 1
else
success = 0
endif
end function
#endif /* WANT_SINGLE_PRECISION_COMPLEX */
......
function elpa_invert_trm_&
&MATH_DATATYPE&
&_wrapper_&
&PRECISION&
& (na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebug) &
result(success) bind(C,name="elpa_invert_trm_&
&MATH_DATATYPE&
&_&
&PRECISION&
")
use, intrinsic :: iso_c_binding
use elpa1_auxiliary, only : elpa_invert_trm_&
&MATH_DATATYPE&
&_&
&PRECISION
implicit none
integer(kind=c_int), value :: na, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols
integer(kind=c_int), value :: wantDebug
integer(kind=c_int) :: success
#if REALCASE == 1
#ifdef USE_ASSUMED_SIZE
real(kind=C_DATATYPE_KIND) :: a(lda,*)
#else
real(kind=C_DATATYPE_KIND) :: a(lda,matrixCols)
#endif
#endif
#if COMPLEXCASE == 1
#ifdef USE_ASSUMED_SIZE
complex(kind=C_DATATYPE_KIND) :: a(lda,*)
#else
complex(kind=C_DATATYPE_KIND) :: a(lda,matrixCols)
#endif
#endif
logical :: wantDebugFortran, successFortran
if (wantDebug .ne. 0) then
wantDebugFortran = .true.
else
wantDebugFortran = .false.
endif
successFortran = elpa_invert_trm_&
&MATH_DATATYPE&
&_&
&PRECISION&
& (na, a, lda, nblk, matrixCols, mpi_comm_rows, mpi_comm_cols, wantDebugFortran)
if (successFortran) then
success = 1
else
success = 0
endif
end function
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment