]> https://gitweb.dealii.org/ - dealii.git/commitdiff
Always inline a new function to restore performance 15900/head
authorMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 21 Aug 2023 10:31:21 +0000 (12:31 +0200)
committerMartin Kronbichler <martin.kronbichler@uni-a.de>
Mon, 21 Aug 2023 10:35:57 +0000 (12:35 +0200)
include/deal.II/matrix_free/tensor_product_kernels.h

index 5abcf6507e7428d05b062db8a0015f0055962f47..fc64a6b23e1f86afcc5e2ad2fbd4252932f63fb9 100644 (file)
@@ -678,14 +678,17 @@ namespace internal
             bool              add,
             typename Number,
             typename Number2>
-  std::enable_if_t<(variant == evaluate_evenodd), void>
-  apply_matrix_vector_product(const Number2 *matrix,
-                              const Number * in,
-                              Number *       out,
-                              int            n_rows_runtime     = 0,
-                              int            n_columns_runtime  = 0,
-                              int            stride_in_runtime  = 0,
-                              int            stride_out_runtime = 0)
+#ifndef DEBUG
+  inline DEAL_II_ALWAYS_INLINE
+#endif
+    std::enable_if_t<(variant == evaluate_evenodd), void>
+    apply_matrix_vector_product(const Number2 *matrix,
+                                const Number * in,
+                                Number *       out,
+                                int            n_rows_runtime     = 0,
+                                int            n_columns_runtime  = 0,
+                                int            stride_in_runtime  = 0,
+                                int            stride_out_runtime = 0)
   {
     const int n_rows = n_rows_static == 0 ? n_rows_runtime : n_rows_static;
     const int n_columns =

In the beginning the Universe was created. This has made a lot of people very angry and has been widely regarded as a bad move.

Douglas Adams


Typeset in Trocchi and Trocchi Bold Sans Serif.