ESPResSo
Extensible Simulation Package for Research on Soft Matter Systems
Loading...
Searching...
No Matches
ReactionKernelIndexed_1_single_precision.cpp
Go to the documentation of this file.
1//======================================================================================================================
2//
3// This file is part of waLBerla. waLBerla is free software: you can
4// redistribute it and/or modify it under the terms of the GNU General Public
5// License as published by the Free Software Foundation, either version 3 of
6// the License, or (at your option) any later version.
7//
8// waLBerla is distributed in the hope that it will be useful, but WITHOUT
9// ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10// FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
11// for more details.
12//
13// You should have received a copy of the GNU General Public License along
14// with waLBerla (see COPYING.txt). If not, see <http://www.gnu.org/licenses/>.
15//
16//! \\file ReactionKernelIndexed_1_single_precision.cpp
17//! \\author pystencils
18//======================================================================================================================
19
20// kernel generated with pystencils v1.4+1.ge851f4e, lbmpy v1.4+1.ge9efe34, sympy v1.12.1, lbmpy_walberla/pystencils_walberla from waLBerla commit 007e77e077ad9d22b5eed6f3d3118240993e553c
21
23#include "core/DataTypes.h"
24#include "core/Macros.h"
25
26#define FUNC_PREFIX
27
28using namespace std;
29
30namespace walberla {
31namespace pystencils {
32
33#ifdef __GNUC__
34#pragma GCC diagnostic push
35#pragma GCC diagnostic ignored "-Wstrict-aliasing"
36#pragma GCC diagnostic ignored "-Wunused-variable"
37#pragma GCC diagnostic ignored "-Wconversion"
38#endif
39
40#ifdef __CUDACC__
41#pragma push
42#ifdef __NVCC_DIAG_PRAGMA_SUPPORT__
43#pragma nv_diag_suppress 177
44#else
45#pragma diag_suppress 177
46#endif
47#endif
48// NOLINTBEGIN(readability-non-const-parameter*)
49namespace internal_6780d252234f1c174ca455eaed762815 {
50static FUNC_PREFIX void reactionkernelindexed_1_single_precision_boundary_ReactionKernelIndexed_1_single_precision(uint8_t *RESTRICT const _data_indexVector, float *RESTRICT _data_rho_0, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int32_t indexVectorSize, float order_0, float rate_coefficient, float stoech_0) {
51 for (int64_t ctr_0 = 0; ctr_0 < indexVectorSize; ctr_0 += 1) {
52 const int32_t x = *((int32_t *)(&_data_indexVector[12 * ctr_0]));
53 const int32_t y = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 4]));
54 const int32_t z = *((int32_t *)(&_data_indexVector[12 * ctr_0 + 8]));
55
56 const float local_rho_0 = _data_rho_0[_stride_rho_0_0 * x + _stride_rho_0_1 * y + _stride_rho_0_2 * z];
57 const float rate_factor = rate_coefficient * powf(local_rho_0, order_0);
58 _data_rho_0[_stride_rho_0_0 * x + _stride_rho_0_1 * y + _stride_rho_0_2 * z] = local_rho_0 + rate_factor * stoech_0;
59 }
60}
61} // namespace internal_6780d252234f1c174ca455eaed762815
62
63// NOLINTEND(readability-non-const-parameter*)
64#ifdef __GNUC__
65#pragma GCC diagnostic pop
66#endif
67
68#ifdef __CUDACC__
69#pragma pop
70#endif
71
72void ReactionKernelIndexed_1_single_precision::run_impl(IBlock *block, IndexVectors::Type type) {
73 auto *indexVectors = block->uncheckedFastGetData<IndexVectors>(indexVectorID);
74 int32_t indexVectorSize = int32_c(indexVectors->indexVector(type).size());
75 if (indexVectorSize == 0)
76 return;
77
78 auto pointer = indexVectors->pointerCpu(type);
79
80 uint8_t *_data_indexVector = reinterpret_cast<uint8_t *>(pointer);
81
82 auto rho_0 = block->getData<field::GhostLayerField<float, 1>>(rho_0ID);
83
84 auto &stoech_0 = stoech_0_;
85 auto &order_0 = order_0_;
86 auto &rate_coefficient = rate_coefficient_;
87 WALBERLA_ASSERT_GREATER_EQUAL(0, -int_c(rho_0->nrOfGhostLayers()))
88 float *RESTRICT _data_rho_0 = rho_0->dataAt(0, 0, 0, 0);
89 const int64_t _stride_rho_0_0 = int64_t(rho_0->xStride());
90 const int64_t _stride_rho_0_1 = int64_t(rho_0->yStride());
91 const int64_t _stride_rho_0_2 = int64_t(rho_0->zStride());
92 internal_6780d252234f1c174ca455eaed762815::reactionkernelindexed_1_single_precision_boundary_ReactionKernelIndexed_1_single_precision(_data_indexVector, _data_rho_0, _stride_rho_0_0, _stride_rho_0_1, _stride_rho_0_2, indexVectorSize, order_0, rate_coefficient, stoech_0);
93}
94
98
102
106
107} // namespace pystencils
108} // namespace walberla
#define FUNC_PREFIX
\file AdvectiveFluxKernel_double_precision.cpp \author pystencils
#define RESTRICT
\file AdvectiveFluxKernel_double_precision.h \author pystencils
cudaStream_t stream[1]
CUDA streams for parallel computing on CPU and GPU.
static double * block(double *p, std::size_t index, std::size_t size)
Definition elc.cpp:177
STL namespace.
static FUNC_PREFIX void reactionkernelindexed_1_single_precision_boundary_ReactionKernelIndexed_1_single_precision(uint8_t *RESTRICT const _data_indexVector, float *RESTRICT _data_rho_0, int64_t const _stride_rho_0_0, int64_t const _stride_rho_0_1, int64_t const _stride_rho_0_2, int32_t indexVectorSize, float order_0, float rate_coefficient, float stoech_0)
\file PackInfoPdfDoublePrecision.cpp \author pystencils