diff options
author | CNugteren <web@cedricnugteren.nl> | 2015-09-18 17:46:41 +0200 |
---|---|---|
committer | CNugteren <web@cedricnugteren.nl> | 2015-09-18 17:46:41 +0200 |
commit | 93dddda63e4345961a779ee125d748c1eeef4769 (patch) | |
tree | ecb99fedbe765152259dec595833431b703e2fb3 /include/internal/routines | |
parent | 4507ba4997cd546418eae0972c018073ac7b36aa (diff) |
Improved the organization and performance of level 2 routines
Diffstat (limited to 'include/internal/routines')
-rw-r--r-- | include/internal/routines/level2/xgbmv.h | 17 | ||||
-rw-r--r-- | include/internal/routines/level2/xgemv.h | 11 | ||||
-rw-r--r-- | include/internal/routines/level2/xhemv.h | 17 | ||||
-rw-r--r-- | include/internal/routines/level2/xsymv.h | 15 |
4 files changed, 22 insertions, 38 deletions
diff --git a/include/internal/routines/level2/xgbmv.h b/include/internal/routines/level2/xgbmv.h index 763168d4..27b033e9 100644 --- a/include/internal/routines/level2/xgbmv.h +++ b/include/internal/routines/level2/xgbmv.h @@ -7,10 +7,9 @@ // Author(s): // Cedric Nugteren <www.cedricnugteren.nl> // -// This file implements the Xgbmv routine. It is based on the generalized matrix multiplication +// This file implements the Xgbmv routine. It is based on the generalized mat-vec multiplication // routine (Xgemv). The Xgbmv class inherits from the templated class Xgemv, allowing it to call the -// "DoGemm" function directly. The "DoGbmv" function first preprocesses the banded matrix by -// transforming it into a general matrix, and then calls the regular GEMV code. +// "MatVec" function directly. // // ================================================================================================= @@ -27,16 +26,8 @@ template <typename T> class Xgbmv: public Xgemv<T> { public: - // Members and methods from the base class - using Routine<T>::db_; - using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; - using Routine<T>::TestMatrixA; - using Routine<T>::RunKernel; - using Routine<T>::ErrorIn; - - // Uses the regular Xgemv routine - using Xgemv<T>::DoGemv; + // Uses the generic matrix-vector routine + using Xgemv<T>::MatVec; // Constructor Xgbmv(Queue &queue, Event &event, const std::string &name = "GBMV"); diff --git a/include/internal/routines/level2/xgemv.h b/include/internal/routines/level2/xgemv.h index 1e120a5e..d18f05b4 100644 --- a/include/internal/routines/level2/xgemv.h +++ b/include/internal/routines/level2/xgemv.h @@ -47,6 +47,17 @@ class Xgemv: public Routine<T> { const T beta, const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc); + // Generic version used also for other matrix-vector multiplications + StatusCode MatVec(const Layout layout, const Transpose a_transpose, + const size_t m, const size_t n, + const T alpha, + const Buffer<T> &a_buffer, const size_t a_offset, const size_t a_ld, + const Buffer<T> &x_buffer, const size_t x_offset, const size_t x_inc, + const T beta, + const Buffer<T> &y_buffer, const size_t y_offset, const size_t y_inc, + bool fast_kernel, bool fast_kernel_rot, bool reversed, + const size_t kl, const size_t ku); + private: // Static variable to get the precision const static Precision precision_; diff --git a/include/internal/routines/level2/xhemv.h b/include/internal/routines/level2/xhemv.h index 311ad9f8..b74db760 100644 --- a/include/internal/routines/level2/xhemv.h +++ b/include/internal/routines/level2/xhemv.h @@ -7,10 +7,9 @@ // Author(s): // Cedric Nugteren <www.cedricnugteren.nl> // -// This file implements the Xhemv routine. It is based on the generalized matrix multiplication +// This file implements the Xhemv routine. It is based on the generalized mat-vec multiplication // routine (Xgemv). The Xhemv class inherits from the templated class Xgemv, allowing it to call the -// "DoGemm" function directly. The "DoHemv" function first preprocesses the hermetian matrix by -// transforming it into a general matrix, and then calls the regular GEMV code. +// "MatVec" function directly. // // ================================================================================================= @@ -27,16 +26,8 @@ template <typename T> class Xhemv: public Xgemv<T> { public: - // Members and methods from the base class - using Routine<T>::db_; - using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; - using Routine<T>::TestMatrixA; - using Routine<T>::RunKernel; - using Routine<T>::ErrorIn; - - // Uses the regular Xgemv routine - using Xgemv<T>::DoGemv; + // Uses the generic matrix-vector routine + using Xgemv<T>::MatVec; // Constructor Xhemv(Queue &queue, Event &event, const std::string &name = "HEMV"); diff --git a/include/internal/routines/level2/xsymv.h b/include/internal/routines/level2/xsymv.h index ab6da6d1..c7b92702 100644 --- a/include/internal/routines/level2/xsymv.h +++ b/include/internal/routines/level2/xsymv.h @@ -9,8 +9,7 @@ // // This file implements the Xsymv routine. It is based on the generalized mat-vec multiplication // routine (Xgemv). The Xsymv class inherits from the templated class Xgemv, allowing it to call the -// "DoGemm" function directly. The "DoSymv" function first preprocesses the symmetric matrix by -// transforming it into a general matrix, and then calls the regular GEMV code. +// "MatVec" function directly. // // ================================================================================================= @@ -27,16 +26,8 @@ template <typename T> class Xsymv: public Xgemv<T> { public: - // Members and methods from the base class - using Routine<T>::db_; - using Routine<T>::context_; - using Routine<T>::GetProgramFromCache; - using Routine<T>::TestMatrixA; - using Routine<T>::RunKernel; - using Routine<T>::ErrorIn; - - // Uses the regular Xgemv routine - using Xgemv<T>::DoGemv; + // Uses the generic matrix-vector routine + using Xgemv<T>::MatVec; // Constructor Xsymv(Queue &queue, Event &event, const std::string &name = "SYMV"); |