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"
38#define RESTRICT __restrict__
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_)
62 for (
auto p : cache_pdfs_) {
70 const CellInterval &globalCellInterval,
71 cell_idx_t ghostLayers, IBlock *
block,
72 gpuStream_t
stream =
nullptr);
78 static std::function<void(IBlock *)>
79 getSweep(
const shared_ptr<StreamSweepDoublePrecisionCUDA> &kernel) {
80 return [kernel](IBlock *b) { kernel->run(b); };
84 const shared_ptr<StreamSweepDoublePrecisionCUDA> &kernel,
85 const shared_ptr<StructuredBlockStorage> &blocks,
86 const CellInterval &globalCellInterval, cell_idx_t ghostLayers = 1) {
87 return [kernel, blocks, globalCellInterval,
88 ghostLayers](IBlock *b, gpuStream_t
stream =
nullptr) {
89 kernel->runOnCellInterval(blocks, globalCellInterval, ghostLayers, b,
98 std::function<void(IBlock *)>
100 const CellInterval &globalCellInterval,
101 cell_idx_t ghostLayers = 1,
102 gpuStream_t
stream =
nullptr) {
103 return [
this, blocks, globalCellInterval, ghostLayers,
stream](IBlock *b) {
109 void configure(
const shared_ptr<StructuredBlockStorage> &blocks,
117 std::set<gpu::GPUField<double> *,
118 field::SwapableCompare<gpu::GPUField<double> *>>
125#if (defined WALBERLA_CXX_COMPILER_IS_GNU) || \
126 (defined WALBERLA_CXX_COMPILER_IS_CLANG)
127#pragma GCC diagnostic pop
void configure(const shared_ptr< StructuredBlockStorage > &blocks, IBlock *block)
static std::function< void(IBlock *, gpuStream_t)> getSweepOnCellInterval(const shared_ptr< StreamSweepDoublePrecisionCUDA > &kernel, const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers=1)
void run(IBlock *block, gpuStream_t stream=nullptr)
std::function< void(IBlock *)> getSweep(gpuStream_t stream=nullptr)
StreamSweepDoublePrecisionCUDA(BlockDataID forceID_, BlockDataID pdfsID_, BlockDataID velocityID_)
void operator()(IBlock *block, gpuStream_t stream=nullptr)
static std::function< void(IBlock *)> getSweep(const shared_ptr< StreamSweepDoublePrecisionCUDA > &kernel)
void runOnCellInterval(const shared_ptr< StructuredBlockStorage > &blocks, const CellInterval &globalCellInterval, cell_idx_t ghostLayers, IBlock *block, 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)
~StreamSweepDoublePrecisionCUDA()
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