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 +12 −6 Original line number Diff line number Diff line Loading @@ -12,23 +12,29 @@ * legacy serial function implementation is used as a fall-back. */ #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #else #define lapack_int int64_t #endif #ifndef INCLUDE_ALGEBRAIC_H_ #define INCLUDE_ALGEBRAIC_H_ #ifndef np_int #ifndef lapack_int #define np_int int64_t #else #define np_int lapack_int #endif #endif /*! \brief Perform in-place matrix inversion. * * \param mat: `complex double **` The matrix to be inverted (must be a square matrix). * \param size: `lapack_int` The size of the matrix (i.e. the number of its rows or columns). * \param size: `np_int` The size of the matrix (i.e. the number of its rows or columns). * \param ier: `int &` Reference to an integer variable for returning a result flag. * \param max_size: `lapack_int` The maximum expected size (required by some call-backs, * \param max_size: `np_int` The maximum expected size (required by some call-backs, * optional, defaults to 0). */ void invert_matrix(dcomplex **mat, np_int size, int &ier, np_int max_size=0); Loading src/libnptm/algebraic.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,16 @@ typedef __complex__ double dcomplex; #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 #ifndef INCLUDE_ALGEBRAIC_H_ #include "../include/algebraic.h" Loading src/libnptm/lapack_calls.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -4,16 +4,27 @@ typedef __complex__ double dcomplex; #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(dcomplex **mat, lapack_int n, int &jer) { jer = 0; __complex__ double *arr = new dcomplex[n * n]; dcomplex *arr = new dcomplex[n * n]; const dcomplex uim = 0.0 + 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 @@ -23,8 +34,14 @@ void zinvert(dcomplex **mat, lapack_int n, int &jer) { lapack_int* IPIV = new lapack_int[n](); if (!LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr, n, IPIV)) jer = 1; if (!LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr, n, IPIV)) jer = 2; #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 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 +12 −6 Original line number Diff line number Diff line Loading @@ -12,23 +12,29 @@ * legacy serial function implementation is used as a fall-back. */ #ifdef USE_LAPACK #ifdef USE_MKL #include <mkl_lapacke.h> #else #include <lapacke.h> #endif #else #define lapack_int int64_t #endif #ifndef INCLUDE_ALGEBRAIC_H_ #define INCLUDE_ALGEBRAIC_H_ #ifndef np_int #ifndef lapack_int #define np_int int64_t #else #define np_int lapack_int #endif #endif /*! \brief Perform in-place matrix inversion. * * \param mat: `complex double **` The matrix to be inverted (must be a square matrix). * \param size: `lapack_int` The size of the matrix (i.e. the number of its rows or columns). * \param size: `np_int` The size of the matrix (i.e. the number of its rows or columns). * \param ier: `int &` Reference to an integer variable for returning a result flag. * \param max_size: `lapack_int` The maximum expected size (required by some call-backs, * \param max_size: `np_int` The maximum expected size (required by some call-backs, * optional, defaults to 0). */ void invert_matrix(dcomplex **mat, np_int size, int &ier, np_int max_size=0); Loading
src/libnptm/algebraic.cpp +7 −1 Original line number Diff line number Diff line Loading @@ -9,10 +9,16 @@ typedef __complex__ double dcomplex; #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 #ifndef INCLUDE_ALGEBRAIC_H_ #include "../include/algebraic.h" Loading
src/libnptm/lapack_calls.cpp +21 −4 Original line number Diff line number Diff line Loading @@ -4,16 +4,27 @@ typedef __complex__ double dcomplex; #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(dcomplex **mat, lapack_int n, int &jer) { jer = 0; __complex__ double *arr = new dcomplex[n * n]; dcomplex *arr = new dcomplex[n * n]; const dcomplex uim = 0.0 + 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 @@ -23,8 +34,14 @@ void zinvert(dcomplex **mat, lapack_int n, int &jer) { lapack_int* IPIV = new lapack_int[n](); if (!LAPACKE_zgetrf(LAPACK_ROW_MAJOR, n, n, arr, n, IPIV)) jer = 1; if (!LAPACKE_zgetri(LAPACK_ROW_MAJOR, n, arr, n, IPIV)) jer = 2; #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
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