Loading src/cluster/cluster.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -33,8 +33,12 @@ #endif #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif #endif Loading src/include/algebraic.h +7 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,13 @@ * legacy serial function implementation is used as a fall-back. */ #ifndef lapack_int #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #else #define lapack_int int64_t #endif Loading src/libnptm/algebraic.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,16 @@ #include "../include/algebraic.h" #endif #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif #endif // >>> FALL-BACK FUNCTIONS DECLARATION <<< // extern void lucin(std::complex<double> **mat, int64_t max_size, int64_t size, int &ier); Loading src/libnptm/lapack_calls.cpp +17 −3 Original line number Diff line number Diff line #include <complex> #include <complex.h> #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif #endif #ifdef USE_LAPACK void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { #ifdef USE_LAPACK jer = 0; __complex__ double *arr = new __complex__ double[n * n]; const __complex__ double uim = 1.0*I; #ifdef USE_MKL MKL_Complex16 *arr2 = (MKL_Complex16 *) arr; #endif for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; Loading @@ -20,8 +29,13 @@ void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { lapack_int* IPIV = new lapack_int[n](); #ifdef USE_MKL LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr2, n, IPIV); LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr2, n, IPIV); #else LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr, n, IPIV); LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr, n, IPIV); #endif for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; Loading @@ -30,5 +44,5 @@ void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { } delete[] IPIV; delete[] arr; } #endif } src/make.inc +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) ifdef USE_LAPACK override CXXFLAGS+= -DUSE_LAPACK -DLAPACK_ILP64 ifdef USE_MKL override CXXFLAGS+= -DMKL_ILP64 -I$(MKLROOT)/include override CXXFLAGS+= -DMKL_ILP64 -DUSE_MKL -I$(MKLROOT)/include endif endif endif Loading Loading
src/cluster/cluster.cpp +5 −1 Original line number Diff line number Diff line Loading @@ -33,8 +33,12 @@ #endif #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif #endif Loading
src/include/algebraic.h +7 −1 Original line number Diff line number Diff line Loading @@ -10,7 +10,13 @@ * legacy serial function implementation is used as a fall-back. */ #ifndef lapack_int #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #else #define lapack_int int64_t #endif Loading
src/libnptm/algebraic.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,16 @@ #include "../include/algebraic.h" #endif #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif #endif // >>> FALL-BACK FUNCTIONS DECLARATION <<< // extern void lucin(std::complex<double> **mat, int64_t max_size, int64_t size, int &ier); Loading
src/libnptm/lapack_calls.cpp +17 −3 Original line number Diff line number Diff line #include <complex> #include <complex.h> #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #ifndef INCLUDE_LAPACK_CALLS_H_ #include "lapacke.h" #include "../include/lapack_calls.h" #endif #endif #ifdef USE_LAPACK void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { #ifdef USE_LAPACK jer = 0; __complex__ double *arr = new __complex__ double[n * n]; const __complex__ double uim = 1.0*I; #ifdef USE_MKL MKL_Complex16 *arr2 = (MKL_Complex16 *) arr; #endif for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; Loading @@ -20,8 +29,13 @@ void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { lapack_int* IPIV = new lapack_int[n](); #ifdef USE_MKL LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr2, n, IPIV); LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr2, n, IPIV); #else LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr, n, IPIV); LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr, n, IPIV); #endif for (lapack_int i = 0; i < n; i++) { for (lapack_int j = 0; j < n; j++) { lapack_int idx = i + n * j; Loading @@ -30,5 +44,5 @@ void zinvert(std::complex<double> **mat, lapack_int n, int &jer) { } delete[] IPIV; delete[] arr; } #endif }
src/make.inc +1 −1 Original line number Diff line number Diff line Loading @@ -77,7 +77,7 @@ override CXXFLAGS=-O3 -ggdb -pg -coverage -I$(HDF5_INCLUDE) ifdef USE_LAPACK override CXXFLAGS+= -DUSE_LAPACK -DLAPACK_ILP64 ifdef USE_MKL override CXXFLAGS+= -DMKL_ILP64 -I$(MKLROOT)/include override CXXFLAGS+= -DMKL_ILP64 -DUSE_MKL -I$(MKLROOT)/include endif endif endif Loading