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"
61 BlockDataID velocityID_,
double rho_0)
62 : forceID(forceID_), pdfsID(pdfsID_), velocityID(velocityID_),
68 const CellInterval &globalCellInterval,
69 cell_idx_t ghostLayers, IBlock *
block,
70 gpuStream_t
stream =
nullptr);
76 static std::function<void(IBlock *)>
77 getSweep(
const shared_ptr<InitialPDFsSetterDoublePrecisionCUDA> &kernel) {
78 return [kernel](IBlock *b) { kernel->run(b); };
82 const shared_ptr<InitialPDFsSetterDoublePrecisionCUDA> &kernel,
83 const shared_ptr<StructuredBlockStorage> &blocks,
84 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
85 return [kernel, blocks, globalCellInterval,
86 ghostLayers](IBlock *b, gpuStream_t
stream =
nullptr) {
87 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b,
96 std::function<void(IBlock *)>
98 const CellInterval &globalCellInterval,
99 cell_idx_t ghostLayers = 1,
100 gpuStream_t
stream =
nullptr) {
101 return [
this, blocks, globalCellInterval, ghostLayers,
stream](IBlock *b) {
107 void configure(
const shared_ptr<StructuredBlockStorage> & ,
111 inline void setRho_0(
const double value) { rho_0_ = value; }
116 BlockDataID velocityID;
123#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
124 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
125#pragma GCC diagnostic pop
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block, gpuStream_t stream=nullptr)
std::function< void(IBlock *)> getSweep(gpuStream_t stream=nullptr)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1, gpuStream_t stream=nullptr)
void configure(const shared_ptr< StructuredBlockStorage > &, IBlock *)
static std::function< void(IBlock *)> getSweep(const shared_ptr< InitialPDFsSetterDoublePrecisionCUDA > &kernel)
void run(IBlock *block, gpuStream_t stream=nullptr)
InitialPDFsSetterDoublePrecisionCUDA(BlockDataID forceID_, BlockDataID pdfsID_, BlockDataID velocityID_, double rho_0)
static std::function< void(IBlock *, gpuStream_t)> getSweepOnCellInterval(const shared_ptr< InitialPDFsSetterDoublePrecisionCUDA > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
void setRho_0(const double value)
void operator()(IBlock *block, gpuStream_t stream=nullptr)
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