From e1eccfad3f3b4e9e2ac94ca9a43256144ef72888 Mon Sep 17 00:00:00 2001 From: Gael Guennebaud Date: Mon, 5 Jul 2010 16:18:09 +0200 Subject: add intitial support for the vectorization of complex --- bench/bench_gemm.cpp | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'bench/bench_gemm.cpp') diff --git a/bench/bench_gemm.cpp b/bench/bench_gemm.cpp index 4142236e9..0da87b583 100644 --- a/bench/bench_gemm.cpp +++ b/bench/bench_gemm.cpp @@ -10,7 +10,7 @@ using namespace std; using namespace Eigen; #ifndef SCALAR -#define SCALAR float +#define SCALAR std::complex #endif typedef SCALAR Scalar; @@ -26,6 +26,8 @@ static float fone = 1; static float fzero = 0; static double done = 1; static double szero = 0; +static std::complex cfone = 1; +static std::complex cfzero = 0; static char notrans = 'N'; static char trans = 'T'; static char nonunit = 'N'; @@ -44,6 +46,17 @@ void blas_gemm(const MatrixXf& a, const MatrixXf& b, MatrixXf& c) c.data(),&ldc); } +void blas_gemm(const MatrixXcf& a, const MatrixXcf& b, MatrixXcf& c) +{ + int M = c.rows(); int N = c.cols(); int K = a.cols(); + int lda = a.rows(); int ldb = b.rows(); int ldc = c.rows(); + + cgemm_(¬rans,¬rans,&M,&N,&K,(float*)&cfone, + const_cast((const float*)a.data()),&lda, + const_cast((const float*)b.data()),&ldb,(float*)&cfone, + (float*)c.data(),&ldc); +} + void blas_gemm(const MatrixXd& a, const MatrixXd& b, MatrixXd& c) { int M = c.rows(); int N = c.cols(); int K = a.cols(); @@ -98,7 +111,7 @@ int main(int argc, char ** argv) } if(cache_size>0) - setCpuCacheSizes(cache_size,32*cache_size); + setCpuCacheSizes(cache_size,96*cache_size); int m = s; int n = s; -- cgit v1.2.3