diff --git a/mini-apps/heat3d/types.hpp b/mini-apps/heat3d/types.hpp index ecfac88..6a10e83 100644 --- a/mini-apps/heat3d/types.hpp +++ b/mini-apps/heat3d/types.hpp @@ -14,7 +14,7 @@ namespace stdex = std::experimental; #if defined(_NVHPC_CUDA) || defined(__CUDACC__) using default_layout = stdex::layout_left; #else - using default_layout = stdex::layout_right; + using default_layout = stdex::layout_left; #endif template diff --git a/tutorial/05_heat2d/heat2D.cpp b/tutorial/05_heat2d/heat2D.cpp index 76ae0de..4ba08b9 100644 --- a/tutorial/05_heat2d/heat2D.cpp +++ b/tutorial/05_heat2d/heat2D.cpp @@ -4,6 +4,7 @@ #include #include #include +#include #include #include #include @@ -15,7 +16,11 @@ #include "exec/on.hpp" #include "heat2D.hpp" -using Vector = thrust::device_vector; +#if defined(ENABLE_OPENMP) + using Vector = thrust::host_vector; +#else + using Vector = thrust::device_vector; +#endif int main(int argc, char *argv[]) { // Set configuration diff --git a/tutorial/05_heat2d/heat2D.hpp b/tutorial/05_heat2d/heat2D.hpp index 11df83a..63fd705 100644 --- a/tutorial/05_heat2d/heat2D.hpp +++ b/tutorial/05_heat2d/heat2D.hpp @@ -163,7 +163,7 @@ void initialize(const Config& conf, const std::size_t n = conf.nx_ * conf.ny_; auto initializer = stdexec::just() | exec::on( scheduler, stdexec::bulk(n, init_functor(conf, x, y, u, un)) ); - stdexec::sync_wait(initializer); + stdexec::sync_wait( std::move(initializer) ); } template @@ -180,7 +180,7 @@ void finalize(const Config& conf, auto analytical_solution = stdexec::just() | exec::on( scheduler, stdexec::bulk(n, analytical_solution_functor(conf, time, x, y, un)) ); - stdexec::sync_wait(analytical_solution); + stdexec::sync_wait( std::move(analytical_solution) ); // Check errors // un: analytical, u: numerical solutions @@ -212,7 +212,7 @@ void step(const Config& conf, auto time_step = stdexec::just() | exec::on( scheduler, stdexec::bulk(n, heat2d_functor(conf, u, un)) ) | stdexec::then( [&]{ std::swap(u, un); }); - stdexec::sync_wait(time_step); + stdexec::sync_wait( std::move(time_step) ); } static void report_performance(const Config& conf, double seconds) {