From 27fc54d05b74cea011a875b46e1860c8c654c07d Mon Sep 17 00:00:00 2001
From: Tobias Leibner <tobias.leibner@uni-muenster.de>
Date: Wed, 13 Jun 2018 15:14:51 +0200
Subject: [PATCH] [lapacke] add MKL vdExp

---
 dune/xt/common/lapacke.cc | 18 ++++++++++++++++--
 dune/xt/common/lapacke.hh | 11 +++++++++++
 2 files changed, 27 insertions(+), 2 deletions(-)

diff --git a/dune/xt/common/lapacke.cc b/dune/xt/common/lapacke.cc
index 078ca9d6f..fdfff273e 100644
--- a/dune/xt/common/lapacke.cc
+++ b/dune/xt/common/lapacke.cc
@@ -18,8 +18,7 @@
 #define lapack_complex_double std::complex<double>
 
 #if HAVE_MKL
-#include <mkl_cblas.h>
-#include <mkl_lapacke.h>
+#include <mkl.h>
 #else // HAVE_MKL
 #if HAVE_LAPACKE
 #include <lapacke.h>
@@ -38,6 +37,21 @@
 namespace Dune {
 namespace XT {
 namespace Common {
+namespace Mkl {
+
+
+void exp(const int n, const double* a, double* y)
+{
+#if HAVE_MKL
+  vdExp(n, a, y);
+#else
+  for (int ii = 0; ii < n; ++ii)
+    y[ii] = std::exp(a[ii]);
+#endif
+}
+
+
+} // namespace Mkl
 namespace Lapacke {
 
 
diff --git a/dune/xt/common/lapacke.hh b/dune/xt/common/lapacke.hh
index 8f18c25d5..8e72047f6 100644
--- a/dune/xt/common/lapacke.hh
+++ b/dune/xt/common/lapacke.hh
@@ -17,6 +17,17 @@
 namespace Dune {
 namespace XT {
 namespace Common {
+namespace Mkl {
+
+
+/**
+ * \brief Wrapper around MKL's vdExp
+ * \sa    vdExp
+ */
+void exp(const int n, const double* a, double* y);
+
+
+} // namespace Mkl
 namespace Lapacke {
 
 
-- 
GitLab