From 6d9011da61ce778953703d37a05c8d65465806eb Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Thu, 12 Mar 2020 15:21:00 +0100 Subject: [PATCH] Split instatiations of matrix-free MappingInfo --- source/matrix_free/CMakeLists.txt | 2 ++ source/matrix_free/mapping_info.cc | 20 ++++++++++++++------ source/matrix_free/mapping_info_inst2.cc | 17 +++++++++++++++++ source/matrix_free/mapping_info_inst3.cc | 17 +++++++++++++++++ 4 files changed, 50 insertions(+), 6 deletions(-) create mode 100644 source/matrix_free/mapping_info_inst2.cc create mode 100644 source/matrix_free/mapping_info_inst3.cc diff --git a/source/matrix_free/CMakeLists.txt b/source/matrix_free/CMakeLists.txt index c1b9423f6e..fa27962bdc 100644 --- a/source/matrix_free/CMakeLists.txt +++ b/source/matrix_free/CMakeLists.txt @@ -18,6 +18,8 @@ INCLUDE_DIRECTORIES(BEFORE ${CMAKE_CURRENT_BINARY_DIR}) SET(_src evaluation_selector.cc mapping_info.cc + mapping_info_inst2.cc + mapping_info_inst3.cc matrix_free.cc task_info.cc ) diff --git a/source/matrix_free/mapping_info.cc b/source/matrix_free/mapping_info.cc index 4ee9d63a8f..0e73c2e10e 100644 --- a/source/matrix_free/mapping_info.cc +++ b/source/matrix_free/mapping_info.cc @@ -23,33 +23,41 @@ DEAL_II_NAMESPACE_OPEN +#define SPLIT_INSTANTIATIONS_COUNT 3 +#ifndef SPLIT_INSTANTIATIONS_INDEX +# define SPLIT_INSTANTIATIONS_INDEX 0 +#endif #include "mapping_info.inst" +#if SPLIT_INSTANTIATIONS_INDEX == 0 + template struct internal::MatrixFreeFunctions:: FPArrayComparator>; template struct internal::MatrixFreeFunctions:: FPArrayComparator>; -#if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \ - (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__)) +# if (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__SSE2__)) || \ + (DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 1 && defined(__ALTIVEC__)) template struct internal::MatrixFreeFunctions:: FPArrayComparator>; template struct internal::MatrixFreeFunctions:: FPArrayComparator>; -#endif +# endif -#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__) +# if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 2 && defined(__AVX__) template struct internal::MatrixFreeFunctions:: FPArrayComparator>; template struct internal::MatrixFreeFunctions:: FPArrayComparator>; -#endif +# endif -#if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__) +# if DEAL_II_COMPILER_VECTORIZATION_LEVEL >= 3 && defined(__AVX512F__) template struct internal::MatrixFreeFunctions:: FPArrayComparator>; template struct internal::MatrixFreeFunctions:: FPArrayComparator>; +# endif + #endif DEAL_II_NAMESPACE_CLOSE diff --git a/source/matrix_free/mapping_info_inst2.cc b/source/matrix_free/mapping_info_inst2.cc new file mode 100644 index 0000000000..6811f8d44d --- /dev/null +++ b/source/matrix_free/mapping_info_inst2.cc @@ -0,0 +1,17 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + +#define SPLIT_INSTANTIATIONS_INDEX 1 +#include "mapping_info.cc" diff --git a/source/matrix_free/mapping_info_inst3.cc b/source/matrix_free/mapping_info_inst3.cc new file mode 100644 index 0000000000..534277437d --- /dev/null +++ b/source/matrix_free/mapping_info_inst3.cc @@ -0,0 +1,17 @@ +// --------------------------------------------------------------------- +// +// Copyright (C) 2020 by the deal.II authors +// +// This file is part of the deal.II library. +// +// The deal.II library is free software; you can use it, redistribute +// it, and/or modify it under the terms of the GNU Lesser General +// Public License as published by the Free Software Foundation; either +// version 2.1 of the License, or (at your option) any later version. +// The full text of the license can be found in the file LICENSE.md at +// the top level directory of deal.II. +// +// --------------------------------------------------------------------- + +#define SPLIT_INSTANTIATIONS_INDEX 2 +#include "mapping_info.cc" -- 2.39.5