ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
lb_kernels.hpp
Go to the documentation of this file.
1/*
2 * Copyright (C) 2021-2023 The ESPResSo project
3 *
4 * This file is part of ESPResSo.
5 *
6 * ESPResSo is free software: you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation, either version 3 of the License, or
9 * (at your option) any later version.
10 *
11 * ESPResSo is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 */
19
20#pragma once
21
23
34
35#ifdef __AVX2__
42#else
49#endif
50
51namespace walberla {
52namespace detail {
53
54using lbmpy::Arch;
55
56template <typename FT = double, Arch AT = Arch::CPU> struct KernelTrait {
57#ifdef __AVX2__
58 using CollisionModelThermalized =
59 pystencils::CollideSweepDoublePrecisionThermalizedAVX;
60 using CollisionModelLeesEdwards =
61 pystencils::CollideSweepDoublePrecisionLeesEdwardsAVX;
62 using StreamSweep = pystencils::StreamSweepDoublePrecisionAVX;
63#else
64 using CollisionModelThermalized =
65 pystencils::CollideSweepDoublePrecisionThermalized;
66 using CollisionModelLeesEdwards =
67 pystencils::CollideSweepDoublePrecisionLeesEdwards;
68 using StreamSweep = pystencils::StreamSweepDoublePrecision;
69#endif
70 using InitialPDFsSetter = pystencils::InitialPDFsSetterDoublePrecision;
71 using PackInfoPdf = pystencils::PackInfoPdfDoublePrecision;
72 using PackInfoVec = pystencils::PackInfoVecDoublePrecision;
73};
74
75template <> struct KernelTrait<float, Arch::CPU> {
76#ifdef __AVX2__
77 using CollisionModelThermalized =
78 pystencils::CollideSweepSinglePrecisionThermalizedAVX;
79 using CollisionModelLeesEdwards =
80 pystencils::CollideSweepSinglePrecisionLeesEdwardsAVX;
81 using StreamSweep = pystencils::StreamSweepSinglePrecisionAVX;
82#else
83 using CollisionModelThermalized =
84 pystencils::CollideSweepSinglePrecisionThermalized;
85 using CollisionModelLeesEdwards =
86 pystencils::CollideSweepSinglePrecisionLeesEdwards;
87 using StreamSweep = pystencils::StreamSweepSinglePrecision;
88#endif
89 using InitialPDFsSetter = pystencils::InitialPDFsSetterSinglePrecision;
90 using PackInfoPdf = pystencils::PackInfoPdfSinglePrecision;
91 using PackInfoVec = pystencils::PackInfoVecSinglePrecision;
92};
93
94template <typename FT = double, Arch AT = Arch::CPU>
95struct BoundaryHandlingTrait {
96 using Dynamic_UBB = lbm::Dynamic_UBB_double_precision;
97};
98
99template <> struct BoundaryHandlingTrait<float, Arch::CPU> {
100 using Dynamic_UBB = lbm::Dynamic_UBB_single_precision;
101};
102
103} // namespace detail
104} // namespace walberla
\file PackInfoPdfDoublePrecision.cpp \author pystencils
Arch