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__
45#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
46 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
47#pragma GCC diagnostic push
48#pragma GCC diagnostic ignored "-Wunused-parameter"
49#pragma GCC diagnostic ignored "-Wreorder"
58 BlockDataID velocityID_)
59 : forceID(forceID_), pdfsID(pdfsID_), velocityID(velocityID_) {}
64 const CellInterval &globalCellInterval,
65 cell_idx_t ghostLayers, IBlock *
block,
66 gpuStream_t
stream =
nullptr);
72 static std::function<void(IBlock *)>
73 getSweep(
const shared_ptr<UpdateVelFromPDFDoublePrecisionCUDA> &kernel) {
74 return [kernel](IBlock *b) { kernel->run(b); };
78 const shared_ptr<UpdateVelFromPDFDoublePrecisionCUDA> &kernel,
79 const shared_ptr<StructuredBlockStorage> &blocks,
80 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
81 return [kernel, blocks, globalCellInterval,
82 ghostLayers](IBlock *b, gpuStream_t
stream =
nullptr) {
83 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b,
92 std::function<void(IBlock *)>
94 const CellInterval &globalCellInterval,
95 cell_idx_t ghostLayers = 1,
96 gpuStream_t
stream =
nullptr) {
97 return [
this, blocks, globalCellInterval, ghostLayers,
stream](IBlock *b) {
103 void configure(
const shared_ptr<StructuredBlockStorage> & ,
109 BlockDataID velocityID;
115#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
116 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
117#pragma GCC diagnostic pop
void configure(const shared_ptr< StructuredBlockStorage > &, IBlock *)
static std::function< void(IBlock *)> getSweep(const shared_ptr< UpdateVelFromPDFDoublePrecisionCUDA > &kernel)
static std::function< void(IBlock *, gpuStream_t)> getSweepOnCellInterval(const shared_ptr< UpdateVelFromPDFDoublePrecisionCUDA > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
std::function< void(IBlock *)> getSweepOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1, gpuStream_t stream=nullptr)
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)
void operator()(IBlock *block, gpuStream_t stream=nullptr)
UpdateVelFromPDFDoublePrecisionCUDA(BlockDataID forceID_, BlockDataID pdfsID_, BlockDataID velocityID_)
std::function< void(IBlock *)> getSweep(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