25#include "core/DataTypes.h"
26#include "core/logging/Logging.h"
28#include "gpu/GPUField.h"
29#include "gpu/GPUWrapper.h"
31#include "domain_decomposition/BlockDataID.h"
32#include "domain_decomposition/IBlock.h"
33#include "domain_decomposition/StructuredBlockStorage.h"
34#include "field/SwapableCompare.h"
37#include <unordered_map>
40#define RESTRICT __restrict__
42#define RESTRICT __restrict
47#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
48 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
49#pragma GCC diagnostic push
50#pragma GCC diagnostic ignored "-Wunused-parameter"
51#pragma GCC diagnostic ignored "-Wreorder"
60 BlockDataID rho_0ID_, BlockDataID rho_1ID_, BlockDataID rho_2ID_,
61 float order_0,
float order_1,
float order_2,
float rate_coefficient,
62 float stoech_0,
float stoech_1,
float stoech_2)
63 : rho_0ID(rho_0ID_), rho_1ID(rho_1ID_), rho_2ID(rho_2ID_),
64 order_0_(order_0), order_1_(order_1), order_2_(order_2),
65 rate_coefficient_(rate_coefficient), stoech_0_(stoech_0),
66 stoech_1_(stoech_1), stoech_2_(stoech_2) {}
71 const CellInterval &globalCellInterval,
72 cell_idx_t ghostLayers, IBlock *
block,
73 gpuStream_t
stream =
nullptr);
80 const shared_ptr<ReactionKernelBulk_3_single_precision_CUDA> &kernel) {
81 return [kernel](IBlock *b) { kernel->run(b); };
85 const shared_ptr<ReactionKernelBulk_3_single_precision_CUDA> &kernel,
86 const shared_ptr<StructuredBlockStorage> &blocks,
87 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
88 return [kernel, blocks, globalCellInterval,
89 ghostLayers](IBlock *b, gpuStream_t
stream =
nullptr) {
90 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b,
99 std::function<void(IBlock *)>
101 const CellInterval &globalCellInterval,
102 cell_idx_t ghostLayers = 1,
103 gpuStream_t
stream =
nullptr) {
104 return [
this, blocks, globalCellInterval, ghostLayers,
stream](IBlock *b) {
110 void configure(
const shared_ptr<StructuredBlockStorage> & ,
120 inline void setOrder_0(
const float value) { order_0_ = value; }
121 inline void setOrder_1(
const float value) { order_1_ = value; }
122 inline void setOrder_2(
const float value) { order_2_ = value; }
124 rate_coefficient_ = value;
137 float rate_coefficient_;
146#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
147 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
148#pragma GCC diagnostic pop
void setStoech_1(const float value)
void configure(const shared_ptr< StructuredBlockStorage > &, IBlock *)
void setOrder_2(const float value)
static std::function< void(IBlock *)> getSweep(const shared_ptr< ReactionKernelBulk_3_single_precision_CUDA > &kernel)
float getStoech_0() const
float getRate_coefficient() const
float getStoech_1() const
void operator()(IBlock *block, gpuStream_t stream=nullptr)
void setOrder_0(const float value)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1, gpuStream_t stream=nullptr)
void setRate_coefficient(const float value)
void setStoech_0(const float value)
void setOrder_1(const float value)
void setStoech_2(const float value)
float getStoech_2() const
std::function< void(IBlock *)> getSweep(gpuStream_t stream=nullptr)
ReactionKernelBulk_3_single_precision_CUDA(BlockDataID rho_0ID_, BlockDataID rho_1ID_, BlockDataID rho_2ID_, float order_0, float order_1, float order_2, float rate_coefficient, float stoech_0, float stoech_1, float stoech_2)
void run(IBlock *block, gpuStream_t stream=nullptr)
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block, gpuStream_t stream=nullptr)
static std::function< void(IBlock *, gpuStream_t)> getSweepOnCellInterval(const shared_ptr< ReactionKernelBulk_3_single_precision_CUDA > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
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)
\file PackInfoPdfDoublePrecision.cpp \author pystencils