diff --git a/run_3d.sh b/run_3d.sh index c471932..909a2f5 100755 --- a/run_3d.sh +++ b/run_3d.sh @@ -7,7 +7,7 @@ set -e root_dir="$(cd "$(dirname "$0")" && pwd)" pffdtd_engine="$root_dir/build/src/cpp/pffdtd-engine" -pffdtd_engine="$root_dir/cmake-build-sycl/src/cpp/pffdtd-engine" +pffdtd_engine="$root_dir/cmake-build-cuda/src/cpp/pffdtd-engine" sim_name="ProStudio" sim_setup="${sim_name}.py" diff --git a/src/cpp/pffdtd/engine_3d_cpu.cpp b/src/cpp/pffdtd/engine_3d_cpu.cpp index a7840d7..9b784a8 100644 --- a/src/cpp/pffdtd/engine_3d_cpu.cpp +++ b/src/cpp/pffdtd/engine_3d_cpu.cpp @@ -78,7 +78,7 @@ auto process_bnl_fd( return getTime() - start; } -auto run(Simulation3D& sd) -> double { +auto run(Simulation3D& sd) -> void { // keep local ints, scalars int64_t const Ns = sd.Ns; int64_t const Nr = sd.Nr; @@ -366,12 +366,10 @@ auto run(Simulation3D& sd) -> double { fmt::println("Air update: {:.6}s, {:.2} Mvox/s", elapsedAir, Npts * Nt / 1e6 / elapsedAir); fmt::println("Boundary loop: {:.6}s, {:.2} Mvox/s", elapsedBn, Nb * Nt / 1e6 / elapsedBn); fmt::println("Combined (total): {:.6}s, {:.2} Mvox/s", elapsed, Npts * Nt / 1e6 / elapsed); - - return elapsed; } } // namespace -auto Engine3DCPU::operator()(Simulation3D& sim) const -> double { return run(sim); } +auto Engine3DCPU::operator()(Simulation3D& sim) const -> void { run(sim); } } // namespace pffdtd diff --git a/src/cpp/pffdtd/engine_3d_cpu.hpp b/src/cpp/pffdtd/engine_3d_cpu.hpp index 6d57416..02ce9f8 100644 --- a/src/cpp/pffdtd/engine_3d_cpu.hpp +++ b/src/cpp/pffdtd/engine_3d_cpu.hpp @@ -9,7 +9,7 @@ namespace pffdtd { struct Engine3DCPU { - auto operator()(Simulation3D& sim) const -> double; + auto operator()(Simulation3D& sim) const -> void; }; } // namespace pffdtd diff --git a/src/cpp/pffdtd/engine_3d_cuda.cu b/src/cpp/pffdtd/engine_3d_cuda.cu index 95d7347..a8b1f9e 100644 --- a/src/cpp/pffdtd/engine_3d_cuda.cu +++ b/src/cpp/pffdtd/engine_3d_cuda.cu @@ -680,7 +680,7 @@ void split_data(Simulation3D const* sim, std::span> ghds) { } // run the sim! -static auto run(Simulation3D const& sim) -> double { +static auto run(Simulation3D const& sim) -> void { // if you want to test synchronous, env variable for that char const* s = getenv("CUDA_LAUNCH_BLOCKING"); if (s != nullptr) { @@ -1357,9 +1357,8 @@ static auto run(Simulation3D const& sim) -> double { std::printf("Boundary loop: %.6fs, %.2f Mvox/s\n", elapsedBoundary, sim.Nb * sim.Nt / 1e6 / elapsedBoundary); std::printf("Air update: %.6fs, %.2f Mvox/s\n", elapsedAir, sim.Npts * sim.Nt / 1e6 / elapsedAir); std::printf("Combined (total): %.6fs, %.2f Mvox/s\n", elapsed, sim.Npts * sim.Nt / 1e6 / elapsed); - return elapsed; } -auto Engine3DCUDA::operator()(Simulation3D& sim) const -> double { return run(sim); } +auto Engine3DCUDA::operator()(Simulation3D& sim) const -> void { run(sim); } } // namespace pffdtd diff --git a/src/cpp/pffdtd/engine_3d_cuda.hpp b/src/cpp/pffdtd/engine_3d_cuda.hpp index 58abc49..20e6f78 100644 --- a/src/cpp/pffdtd/engine_3d_cuda.hpp +++ b/src/cpp/pffdtd/engine_3d_cuda.hpp @@ -13,7 +13,7 @@ namespace pffdtd { struct Engine3DCUDA { - auto operator()(Simulation3D& sim) const -> double; + auto operator()(Simulation3D& sim) const -> void; }; } // namespace pffdtd diff --git a/src/cpp/pffdtd/engine_3d_sycl.cpp b/src/cpp/pffdtd/engine_3d_sycl.cpp index 30d4523..d4a4e94 100644 --- a/src/cpp/pffdtd/engine_3d_sycl.cpp +++ b/src/cpp/pffdtd/engine_3d_sycl.cpp @@ -11,7 +11,7 @@ namespace pffdtd { -auto Engine3DSYCL::operator()(Simulation3D& sim) const -> double { +auto Engine3DSYCL::operator()(Simulation3D& sim) const -> void { PFFDTD_ASSERT(sim.fcc_flag == 0); auto queue = sycl::queue{sycl::property::queue::enable_profiling{}}; @@ -318,10 +318,6 @@ auto Engine3DSYCL::operator()(Simulation3D& sim) const -> double { for (auto i{0UL}; i < static_cast(Nr * Nt); ++i) { sim.u_out[i] = host[i]; } - - fmt::println(""); - - return 0.0; } } // namespace pffdtd diff --git a/src/cpp/pffdtd/engine_3d_sycl.hpp b/src/cpp/pffdtd/engine_3d_sycl.hpp index a7fcb05..a372388 100644 --- a/src/cpp/pffdtd/engine_3d_sycl.hpp +++ b/src/cpp/pffdtd/engine_3d_sycl.hpp @@ -11,7 +11,7 @@ namespace pffdtd { struct Engine3DSYCL { - auto operator()(Simulation3D& sim) const -> double; + auto operator()(Simulation3D& sim) const -> void; }; } // namespace pffdtd