aboutsummaryrefslogtreecommitdiffhomepage
path: root/bench/bench_gemm.cpp
diff options
context:
space:
mode:
authorGravatar Gael Guennebaud <g.gael@free.fr>2010-07-05 16:18:09 +0200
committerGravatar Gael Guennebaud <g.gael@free.fr>2010-07-05 16:18:09 +0200
commite1eccfad3f3b4e9e2ac94ca9a43256144ef72888 (patch)
tree0f4be317c45e33da92ec26f261f7d27e3d752033 /bench/bench_gemm.cpp
parentefb79600b98b210f09d030f5c307b99c45ef0ad5 (diff)
add intitial support for the vectorization of complex<float>
Diffstat (limited to 'bench/bench_gemm.cpp')
-rw-r--r--bench/bench_gemm.cpp17
1 files changed, 15 insertions, 2 deletions
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<float>
#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<float> cfone = 1;
+static std::complex<float> 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_(&notrans,&notrans,&M,&N,&K,(float*)&cfone,
+ const_cast<float*>((const float*)a.data()),&lda,
+ const_cast<float*>((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;