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
36
37#ifdef __AVX2__
42#else
47#endif
48
49namespace walberla {
50namespace detail {
51
52using lbmpy::Arch;
53
54template <typename FT = double, Arch AT = Arch::CPU> struct KernelTrait {
55#ifdef __AVX2__
56 using StreamCollisionModelThermalized =
57 pystencils::StreamCollideSweepThermalizedDoublePrecisionAVX;
58 using StreamCollisionModelLeesEdwards =
59 pystencils::StreamCollideSweepLeesEdwardsDoublePrecisionAVX;
60#else
61 using StreamCollisionModelThermalized =
62 pystencils::StreamCollideSweepThermalizedDoublePrecision;
63 using StreamCollisionModelLeesEdwards =
64 pystencils::StreamCollideSweepLeesEdwardsDoublePrecision;
65#endif
66 using InitialPDFsSetter = pystencils::InitialPDFsSetterDoublePrecision;
67 using UpdateVelFromPDF = pystencils::UpdateVelFromPDFDoublePrecision;
68 using PackInfoPdf = pystencils::PackInfoPdfDoublePrecision;
69 using PackInfoVec = pystencils::PackInfoVecDoublePrecision;
70};
71
72template <> struct KernelTrait<float, Arch::CPU> {
73#ifdef __AVX2__
74 using StreamCollisionModelThermalized =
75 pystencils::StreamCollideSweepThermalizedSinglePrecisionAVX;
76 using StreamCollisionModelLeesEdwards =
77 pystencils::StreamCollideSweepLeesEdwardsSinglePrecisionAVX;
78#else
79 using StreamCollisionModelThermalized =
80 pystencils::StreamCollideSweepThermalizedSinglePrecision;
81 using StreamCollisionModelLeesEdwards =
82 pystencils::StreamCollideSweepLeesEdwardsSinglePrecision;
83#endif
84 using InitialPDFsSetter = pystencils::InitialPDFsSetterSinglePrecision;
85 using UpdateVelFromPDF = pystencils::UpdateVelFromPDFSinglePrecision;
86 using PackInfoPdf = pystencils::PackInfoPdfSinglePrecision;
87 using PackInfoVec = pystencils::PackInfoVecSinglePrecision;
88};
89
90template <typename FT = double, Arch AT = Arch::CPU>
91struct BoundaryHandlingTrait {
92 using DynamicUBB = lbm::DynamicUBBDoublePrecision;
93};
94
95template <> struct BoundaryHandlingTrait<float, Arch::CPU> {
96 using DynamicUBB = lbm::DynamicUBBSinglePrecision;
97};
98
99} // namespace detail
100} // namespace walberla
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
\file PackInfoPdfDoublePrecision.cpp \author pystencils
Arch
P3M kernel architecture.