From 8a82d8a1b9bb5415e8ef584a6da83216790e0452 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ren=C3=A9=20He=C3=9F?= <rene.hess@iwr.uni-heidelberg.de>
Date: Thu, 22 Dec 2016 16:54:03 +0100
Subject: [PATCH] Adjust perftool to new vectorclass.hh and add test

---
 dune/perftool/sumfact/transposereg.hh         |  2 +-
 python/dune/perftool/loopy/mangler.py         |  2 +-
 python/dune/perftool/loopy/target.py          |  4 ++--
 test/sumfact/poisson/CMakeLists.txt           |  5 +++++
 .../opcount_sumfact_poisson_dg_2d_vec.mini    | 20 +++++++++++++++++++
 5 files changed, 29 insertions(+), 4 deletions(-)
 create mode 100644 test/sumfact/poisson/opcount_sumfact_poisson_dg_2d_vec.mini

diff --git a/dune/perftool/sumfact/transposereg.hh b/dune/perftool/sumfact/transposereg.hh
index 81cdbbc8..af50b29c 100644
--- a/dune/perftool/sumfact/transposereg.hh
+++ b/dune/perftool/sumfact/transposereg.hh
@@ -1,7 +1,7 @@
 #ifndef DUNE_PERFTOOL_SUMFACT_TRANSPOSEREG_HH
 #define DUNE_PERFTOOL_SUMFACT_TRANSPOSEREG_HH
 
-#include<dune/perftool/vectorclass/vectorclass.h>
+#include<dune/perftool/common/vectorclass.hh>
 
 /**
  * Transpose a 4x4 matrix given by 4 vector registers (efficiently)
diff --git a/python/dune/perftool/loopy/mangler.py b/python/dune/perftool/loopy/mangler.py
index c0172170..80a3d69a 100644
--- a/python/dune/perftool/loopy/mangler.py
+++ b/python/dune/perftool/loopy/mangler.py
@@ -10,7 +10,7 @@ from loopy import CallMangleInfo
 @function_mangler
 def dune_math_manglers(kernel, name, arg_dtypes):
     if name == "exp":
-        include_file("dune/perftool/vectorclass/vectormath_exp.h", filetag="operatorfile")
+        include_file("dune/perftool/common/vectorclass.hh", filetag="operatorfile")
         return CallMangleInfo("exp",
                               arg_dtypes,
                               arg_dtypes,
diff --git a/python/dune/perftool/loopy/target.py b/python/dune/perftool/loopy/target.py
index 952d6e64..9427a401 100644
--- a/python/dune/perftool/loopy/target.py
+++ b/python/dune/perftool/loopy/target.py
@@ -75,7 +75,7 @@ class DuneExpressionToCExpressionMapper(ExpressionToCExpressionMapper):
         ret = ExpressionToCExpressionMapper.map_constant(self, expr, type_context)
         if get_option('opcounter'):
             if type_context == "f":
-                _type = _type_to_op_counter_type('float')
+                _type = _type_to_op_counter_type('double')
                 ret = Literal("{}({})".format(_type, ret.s))
             if type_context == "d":
                 _type = _type_to_op_counter_type('double')
@@ -182,7 +182,7 @@ class DuneTarget(TargetBase):
 
     def dtype_to_typename(self, dtype):
         if dtype.dtype.kind == "V":
-            include_file("dune/perftool/vectorclass/vectorclass.h", filetag="operatorfile")
+            include_file("dune/perftool/common/vectorclass.hh", filetag="operatorfile")
             return VCLTypeRegistry.names[dtype.dtype]
         else:
             return numpy_to_cpp_dtype(dtype.dtype.name)
diff --git a/test/sumfact/poisson/CMakeLists.txt b/test/sumfact/poisson/CMakeLists.txt
index 889b2985..aab2e764 100644
--- a/test/sumfact/poisson/CMakeLists.txt
+++ b/test/sumfact/poisson/CMakeLists.txt
@@ -16,6 +16,11 @@ dune_add_formcompiler_system_test(UFLFILE opcount_poisson_2d_order2.ufl
                                   INIFILE opcount_poisson_2d_order2.mini
                                   )
 
+dune_add_formcompiler_system_test(UFLFILE poisson_dg_2d.ufl
+                                  BASENAME opcount_sumfact_poisson_dg_2d_vec
+                                  INIFILE opcount_sumfact_poisson_dg_2d_vec.mini
+                                  )
+
 # 3. Poisson Test Case: DG in 2D
 dune_add_formcompiler_system_test(UFLFILE poisson_dg_2d.ufl
                                   BASENAME sumfact_poisson_dg_2d
diff --git a/test/sumfact/poisson/opcount_sumfact_poisson_dg_2d_vec.mini b/test/sumfact/poisson/opcount_sumfact_poisson_dg_2d_vec.mini
new file mode 100644
index 00000000..9ae884dd
--- /dev/null
+++ b/test/sumfact/poisson/opcount_sumfact_poisson_dg_2d_vec.mini
@@ -0,0 +1,20 @@
+__name = opcount_sumfact_poisson_dg_2d_vec
+
+
+cells = 8 8
+extension = 1. 1.
+
+[wrapper.vtkcompare]
+name = {__name}
+reference = poisson_ref
+extension = vtu
+
+[formcompiler]
+numerical_jacobian = 0
+exact_solution_expression = g
+compare_l2errorsquared = 1e-8
+sumfact = 1
+opcounter = 1
+
+[formcompiler.ufl_variants]
+degree = 1
-- 
GitLab