From c30924f6f9f14949720f01fafc463dde95d1ffab Mon Sep 17 00:00:00 2001 From: "Claudius \"keldu\" Holeksa" Date: Sat, 8 Jul 2023 18:46:54 +0200 Subject: c++: Testing apply lambdas --- c++/examples/cavity_2d.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'c++/examples') diff --git a/c++/examples/cavity_2d.cpp b/c++/examples/cavity_2d.cpp index 6caaa11..afa6a91 100644 --- a/c++/examples/cavity_2d.cpp +++ b/c++/examples/cavity_2d.cpp @@ -28,10 +28,23 @@ using Cell = CellData< } +template +void apply_for_cells(Func&& func, saw::data, saw::encode::Native>& dat ){ + for(std::size_t i = 0; i < dat.get_dim_size(0); ++i){ + for(std::size_t j = 0; j < data.get_dim_size(1); ++j){ + func(data.at(i,j), i, j); + } + } +} + int main(){ using namespace kel::lbm; saw::data>, saw::encode::Native> lattice{512, 512}; + apply_for_cells([](auto& cell, std::size_t i, std::size_t j){ + + }, lattice); + return 0; } -- cgit v1.2.3