From af9eaee9bd7982c5ab726b918c0e2e3d509fae8a Mon Sep 17 00:00:00 2001 From: conrad Date: Thu, 24 Feb 2022 11:21:16 +1000 Subject: [PATCH] remove ATLAS related support --- cmake_aux/Modules/ARMA_FindATLAS.cmake | 67 ------ include/armadillo_bits/auxlib_bones.hpp | 2 +- include/armadillo_bits/debug.hpp | 49 ----- src/wrapper1.cpp | 274 +----------------------- 4 files changed, 2 insertions(+), 390 deletions(-) delete mode 100644 cmake_aux/Modules/ARMA_FindATLAS.cmake diff --git a/cmake_aux/Modules/ARMA_FindATLAS.cmake b/cmake_aux/Modules/ARMA_FindATLAS.cmake deleted file mode 100644 index 491a3617..00000000 --- a/cmake_aux/Modules/ARMA_FindATLAS.cmake +++ /dev/null @@ -1,67 +0,0 @@ -find_path(ATLAS_CBLAS_INCLUDE_DIR -NAMES cblas.h -PATHS /usr/include/atlas/ /usr/include/ /usr/local/include/atlas/ /usr/local/include/ -) - -find_path(ATLAS_CLAPACK_INCLUDE_DIR -NAMES clapack.h -PATHS /usr/include/atlas/ /usr/include/ /usr/local/include/atlas/ /usr/local/include/ -) - -if(ATLAS_CBLAS_INCLUDE_DIR AND ATLAS_CLAPACK_INCLUDE_DIR) - if(ATLAS_CBLAS_INCLUDE_DIR STREQUAL ATLAS_CLAPACK_INCLUDE_DIR) - set(ATLAS_INCLUDE_DIR ${ATLAS_CBLAS_INCLUDE_DIR}) - endif() -endif() - - -set(ATLAS_NAMES) -set(ATLAS_NAMES ${ATLAS_NAMES} tatlas) -set(ATLAS_NAMES ${ATLAS_NAMES} satlas) -set(ATLAS_NAMES ${ATLAS_NAMES} atlas ) - -set(ATLAS_TMP_LIBRARY) -set(ATLAS_TMP_LIBRARIES) - - -foreach (ATLAS_NAME ${ATLAS_NAMES}) - find_library(${ATLAS_NAME}_LIBRARY - NAMES ${ATLAS_NAME} - PATHS ${CMAKE_SYSTEM_LIBRARY_PATH} /usr/lib64/atlas /usr/lib64/ /usr/local/lib64/atlas /usr/local/lib64 /usr/lib/atlas /usr/lib /usr/local/lib/atlas /usr/local/lib - ) - - set(ATLAS_TMP_LIBRARY ${${ATLAS_NAME}_LIBRARY}) - - if(ATLAS_TMP_LIBRARY) - set(ATLAS_TMP_LIBRARIES ${ATLAS_TMP_LIBRARIES} ${ATLAS_TMP_LIBRARY}) - endif() -endforeach() - - -# use only one library - -if(ATLAS_TMP_LIBRARIES) - list(GET ATLAS_TMP_LIBRARIES 0 ATLAS_LIBRARY) -endif() - - -if(ATLAS_LIBRARY AND ATLAS_INCLUDE_DIR) - set(ATLAS_LIBRARIES ${ATLAS_LIBRARY}) - set(ATLAS_FOUND "YES") -else() - set(ATLAS_FOUND "NO") -endif() - - -if(ATLAS_FOUND) - if(NOT ATLAS_FIND_QUIETLY) - message(STATUS "Found ATLAS: ${ATLAS_LIBRARIES}") - endif() -else() - if(ATLAS_FIND_REQUIRED) - message(FATAL_ERROR "Could not find ATLAS") - endif() -endif() - - -# mark_as_advanced(ATLAS_LIBRARY ATLAS_INCLUDE_DIR) diff --git a/include/armadillo_bits/auxlib_bones.hpp b/include/armadillo_bits/auxlib_bones.hpp index bef0a92d..d43bb767 100644 --- a/include/armadillo_bits/auxlib_bones.hpp +++ b/include/armadillo_bits/auxlib_bones.hpp @@ -20,7 +20,7 @@ //! @{ -//! interface functions for accessing decompositions in LAPACK and ATLAS +//! low-level interface functions for accessing LAPACK class auxlib { public: diff --git a/include/armadillo_bits/debug.hpp b/include/armadillo_bits/debug.hpp index bc0a2750..c6c9f291 100644 --- a/include/armadillo_bits/debug.hpp +++ b/include/armadillo_bits/debug.hpp @@ -1313,52 +1313,6 @@ arma_assert_blas_size(const T1& A, const T2& B) -template -arma_hot -inline -void -arma_assert_atlas_size(const T1& A) - { - if(sizeof(uword) >= sizeof(int)) - { - bool overflow; - - overflow = (A.n_rows > INT_MAX); - overflow = (A.n_cols > INT_MAX) || overflow; - - if(overflow) - { - arma_stop_runtime_error("integer overflow: matrix dimensions are too large for integer type used by ATLAS"); - } - } - } - - - -template -arma_hot -inline -void -arma_assert_atlas_size(const T1& A, const T2& B) - { - if(sizeof(uword) >= sizeof(int)) - { - bool overflow; - - overflow = (A.n_rows > INT_MAX); - overflow = (A.n_cols > INT_MAX) || overflow; - overflow = (B.n_rows > INT_MAX) || overflow; - overflow = (B.n_cols > INT_MAX) || overflow; - - if(overflow) - { - arma_stop_runtime_error("integer overflow: matrix dimensions are too large for integer type used by ATLAS"); - } - } - } - - - // // macros @@ -1381,7 +1335,6 @@ arma_assert_atlas_size(const T1& A, const T2& B) #define arma_debug_assert_trans_mul_size true ? (void)0 : arma_assert_trans_mul_size #define arma_debug_assert_cube_as_mat true ? (void)0 : arma_assert_cube_as_mat #define arma_debug_assert_blas_size true ? (void)0 : arma_assert_blas_size - #define arma_debug_assert_atlas_size true ? (void)0 : arma_assert_atlas_size #else @@ -1396,7 +1349,6 @@ arma_assert_atlas_size(const T1& A, const T2& B) #define arma_debug_assert_trans_mul_size arma_assert_trans_mul_size #define arma_debug_assert_cube_as_mat arma_assert_cube_as_mat #define arma_debug_assert_blas_size arma_assert_blas_size - #define arma_debug_assert_atlas_size arma_assert_atlas_size #endif @@ -1462,7 +1414,6 @@ arma_assert_atlas_size(const T1& A, const T2& B) out << "@ arma_config::newarp = " << arma_config::newarp << '\n'; out << "@ arma_config::arpack = " << arma_config::arpack << '\n'; out << "@ arma_config::superlu = " << arma_config::superlu << '\n'; - out << "@ arma_config::atlas = " << arma_config::atlas << '\n'; out << "@ arma_config::hdf5 = " << arma_config::hdf5 << '\n'; out << "@ arma_config::good_comp = " << arma_config::good_comp << '\n'; out << "@ arma_config::extra_code = " << arma_config::extra_code << '\n'; diff --git a/src/wrapper1.cpp b/src/wrapper1.cpp index 1ac0acbd..fb8a9a6d 100644 --- a/src/wrapper1.cpp +++ b/src/wrapper1.cpp @@ -27,7 +27,6 @@ #include "armadillo_bits/compiler_setup.hpp" #include "armadillo_bits/typedef_elem.hpp" -#include "armadillo_bits/include_atlas.hpp" #include "armadillo_bits/include_superlu.hpp" @@ -85,7 +84,7 @@ namespace arma -// at this stage we have prototypes for the real blas, lapack and atlas functions +// at this stage we have prototypes for actual blas and lapack functions // now we make the wrapper functions @@ -1221,277 +1220,6 @@ extern "C" } #endif - - - - #if defined(ARMA_USE_ATLAS) - - float wrapper_cblas_sasum(const int N, const float *X, const int incX) - { - return cblas_sasum(N, X, incX); - } - - double wrapper_cblas_dasum(const int N, const double *X, const int incX) - { - return cblas_dasum(N, X, incX); - } - - - - float wrapper_cblas_snrm2(const int N, const float *X, const int incX) - { - return cblas_snrm2(N, X, incX); - } - - double wrapper_cblas_dnrm2(const int N, const double *X, const int incX) - { - return cblas_dnrm2(N, X, incX); - } - - - - float wrapper_cblas_sdot(const int N, const float *X, const int incX, const float *Y, const int incY) - { - return cblas_sdot(N, X, incX, Y, incY); - } - - double wrapper_cblas_ddot(const int N, const double *X, const int incX, const double *Y, const int incY) - { - return cblas_ddot(N, X, incX, Y, incY); - } - - void wrapper_cblas_cdotu_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu) - { - cblas_cdotu_sub(N, X, incX, Y, incY, dotu); - } - - void wrapper_cblas_zdotu_sub(const int N, const void *X, const int incX, const void *Y, const int incY, void *dotu) - { - cblas_zdotu_sub(N, X, incX, Y, incY, dotu); - } - - - - void wrapper_cblas_sgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const float alpha, - const float *A, const int lda, const float *X, const int incX, const float beta, float *Y, const int incY) - { - cblas_sgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY); - } - - void wrapper_cblas_dgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const double alpha, - const double *A, const int lda, const double *X, const int incX, const double beta, double *Y, const int incY) - { - cblas_dgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY); - } - - void wrapper_cblas_cgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha, - const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY) - { - cblas_cgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY); - } - - void wrapper_cblas_zgemv(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const int M, const int N, const void *alpha, - const void *A, const int lda, const void *X, const int incX, const void *beta, void *Y, const int incY) - { - cblas_zgemv(Order, TransA, M, N, alpha, A, lda, X, incX, beta, Y, incY); - } - - - - void wrapper_cblas_sgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, - const int M, const int N, const int K, const float alpha, - const float *A, const int lda, const float *B, const int ldb, const float beta, float *C, const int ldc) - { - cblas_sgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc); - } - - void wrapper_cblas_dgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, - const int M, const int N, const int K, const double alpha, - const double *A, const int lda, const double *B, const int ldb, const double beta, double *C, const int ldc) - { - cblas_dgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc); - } - - void wrapper_cblas_cgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, - const int M, const int N, const int K, const void *alpha, - const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc) - { - cblas_cgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc); - } - - void wrapper_cblas_zgemm(const enum CBLAS_ORDER Order, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_TRANSPOSE TransB, - const int M, const int N, const int K, const void *alpha, - const void *A, const int lda, const void *B, const int ldb, const void *beta, void *C, const int ldc) - { - cblas_zgemm(Order, TransA, TransB, M, N, K, alpha, A, lda, B, ldb, beta, C, ldc); - } - - - - void wrapper_cblas_ssyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, - const int N, const int K, const float alpha, - const float *A, const int lda, const float beta, float *C, const int ldc) - { - cblas_ssyrk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc); - } - - void wrapper_cblas_dsyrk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, - const int N, const int K, const double alpha, - const double *A, const int lda, const double beta, double *C, const int ldc) - { - cblas_dsyrk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc); - } - - - - void wrapper_cblas_cherk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, - const int N, const int K, const float alpha, - const void *A, const int lda, const float beta, void *C, const int ldc) - { - cblas_cherk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc); - } - - void wrapper_cblas_zherk(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE Trans, - const int N, const int K, const double alpha, - const void *A, const int lda, const double beta, void *C, const int ldc) - { - cblas_zherk(Order, Uplo, Trans, N, K, alpha, A, lda, beta, C, ldc); - } - - - - int wrapper_clapack_sgetrf(const enum CBLAS_ORDER Order, const int M, const int N, float *A, const int lda, int *ipiv) - { - return clapack_sgetrf(Order, M, N, A, lda, ipiv); - } - - int wrapper_clapack_dgetrf(const enum CBLAS_ORDER Order, const int M, const int N, double *A, const int lda, int *ipiv) - { - return clapack_dgetrf(Order, M, N, A, lda, ipiv); - } - - int wrapper_clapack_cgetrf(const enum CBLAS_ORDER Order, const int M, const int N, void *A, const int lda, int *ipiv) - { - return clapack_cgetrf(Order, M, N, A, lda, ipiv); - } - - int wrapper_clapack_zgetrf(const enum CBLAS_ORDER Order, const int M, const int N, void *A, const int lda, int *ipiv) - { - return clapack_zgetrf(Order, M, N, A, lda, ipiv); - } - - - - int wrapper_clapack_sgetri(const enum CBLAS_ORDER Order, const int N, float *A, const int lda, const int *ipiv) - { - return clapack_sgetri(Order, N, A, lda, ipiv); - } - - int wrapper_clapack_dgetri(const enum CBLAS_ORDER Order, const int N, double *A, const int lda, const int *ipiv) - { - return clapack_dgetri(Order, N, A, lda, ipiv); - } - - int wrapper_clapack_cgetri(const enum CBLAS_ORDER Order, const int N, void *A, const int lda, const int *ipiv) - { - return clapack_cgetri(Order, N, A, lda, ipiv); - } - - int wrapper_clapack_zgetri(const enum CBLAS_ORDER Order, const int N, void *A, const int lda, const int *ipiv) - { - return clapack_zgetri(Order, N, A, lda, ipiv); - } - - - - int wrapper_clapack_sgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, float *A, const int lda, int *ipiv, float *B, const int ldb) - { - return clapack_sgesv(Order, N, NRHS, A, lda, ipiv, B, ldb); - } - - int wrapper_clapack_dgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, double *A, const int lda, int *ipiv, double *B, const int ldb) - { - return clapack_dgesv(Order, N, NRHS, A, lda, ipiv, B, ldb); - } - - int wrapper_clapack_cgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, void *A, const int lda, int *ipiv, void *B, const int ldb) - { - return clapack_cgesv(Order, N, NRHS, A, lda, ipiv, B, ldb); - } - - int wrapper_clapack_zgesv(const enum CBLAS_ORDER Order, const int N, const int NRHS, void *A, const int lda, int *ipiv, void *B, const int ldb) - { - return clapack_zgesv(Order, N, NRHS, A, lda, ipiv, B, ldb); - } - - - - int wrapper_clapack_spotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, float *A, const int lda) - { - return clapack_spotrf(Order, Uplo, N, A, lda); - } - - int wrapper_clapack_dpotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, double *A, const int lda) - { - return clapack_dpotrf(Order, Uplo, N, A, lda); - } - - int wrapper_clapack_cpotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda) - { - return clapack_cpotrf(Order, Uplo, N, A, lda); - } - - int wrapper_clapack_zpotrf(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda) - { - return clapack_zpotrf(Order, Uplo, N, A, lda); - } - - - - int wrapper_clapack_spotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, float *A, const int lda) - { - return clapack_spotri(Order, Uplo, N, A, lda); - } - - int wrapper_clapack_dpotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, double *A, const int lda) - { - return clapack_dpotri(Order, Uplo, N, A, lda); - } - - int wrapper_clapack_cpotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda) - { - return clapack_cpotri(Order, Uplo, N, A, lda); - } - - int wrapper_clapack_zpotri(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, void *A, const int lda) - { - return clapack_zpotri(Order, Uplo, N, A, lda); - } - - - - int wrapper_clapack_sposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, float *A, const int lda, float *B, const int ldb) - { - return clapack_sposv(Order, Uplo, N, NRHS, A, lda, B, ldb); - } - - int wrapper_clapack_dposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, double *A, const int lda, double *B, const int ldb) - { - return clapack_dposv(Order, Uplo, N, NRHS, A, lda, B, ldb); - } - - int wrapper_clapack_cposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, void *A, const int lda, void *B, const int ldb) - { - return clapack_cposv(Order, Uplo, N, NRHS, A, lda, B, ldb); - } - - int wrapper_clapack_zposv(const enum CBLAS_ORDER Order, const enum CBLAS_UPLO Uplo, const int N, const int NRHS, void *A, const int lda, void *B, const int ldb) - { - return clapack_zposv(Order, Uplo, N, NRHS, A, lda, B, ldb); - } - - - #endif