From 4b81426b43b44aaf5f23f5ec2e9f1d2e418ae1e5 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 11 Nov 2024 10:00:57 -0700 Subject: [PATCH] simplifying cuda analytical test interface --- .../cuda/test_cuda_analytical_rosenbrock.cpp | 84 ++++++------------- 1 file changed, 24 insertions(+), 60 deletions(-) diff --git a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp index 28fbdc1e0..d4fb6e266 100644 --- a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp +++ b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp @@ -142,24 +142,6 @@ TEST(AnalyticalExamplesCudaRosenbrock, BranchedSuperStiffButAnalytical) test_analytical_stiff_branched(six_da, 2e-3, copy_to_device, copy_to_host); } -TEST(AnalyticalExamplesCudaRosenbrock, Robertson) -{ - auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); - test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); - test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); - test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); -} - TEST(AnalyticalExamplesCudaRosenbrock, SurfaceRxn) { test_analytical_surface_rxn(two_1_cell, 1e-2, copy_to_device, copy_to_host); @@ -169,56 +151,38 @@ TEST(AnalyticalExamplesCudaRosenbrock, SurfaceRxn) test_analytical_surface_rxn(six_da_1_cell, 1e-7, copy_to_device, copy_to_host); } -TEST(AnalyticalExamplesCudaRosenbrock, E5) +TEST(AnalyticalExamplesCudaRosenbrock, Robertson) { - auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); - test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); - test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); - test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); + test_analytical_robertson(two_1_cell, 2e-1, copy_to_device, copy_to_host); + test_analytical_robertson(three_1_cell, 2e-1, copy_to_device, copy_to_host); + test_analytical_robertson(four_1_cell, 2e-1, copy_to_device, copy_to_host); + test_analytical_robertson(four_da_1_cell, 2e-1, copy_to_device, copy_to_host); + test_analytical_robertson(six_da_1_cell, 2e-1, copy_to_device, copy_to_host); +} - solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); +TEST(AnalyticalExamplesCudaRosenbrock, E5) +{ + test_analytical_e5(two_1_cell, 1e-3, copy_to_device, copy_to_host); + test_analytical_e5(three_1_cell, 1e-3, copy_to_device, copy_to_host); + test_analytical_e5(four_1_cell, 1e-3, copy_to_device, copy_to_host); + test_analytical_e5(four_da_1_cell, 1e-3, copy_to_device, copy_to_host); + test_analytical_e5(six_da_1_cell, 1e-3, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, Oregonator) { - auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); - test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); - test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); - test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(two_1_cell, 2e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(three_1_cell, 2e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(four_1_cell, 2e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(four_da_1_cell, 2e-3, copy_to_device, copy_to_host); + test_analytical_oregonator(six_da_1_cell, 2e-3, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, HIRES) { - auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); - test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); - test_analytical_hires(solver, 1e-7, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); - test_analytical_hires(solver, 1e-7, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); - - solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); - test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); + test_analytical_hires(two_1_cell, 1e-6, copy_to_device, copy_to_host); + test_analytical_hires(three_1_cell, 1e-7, copy_to_device, copy_to_host); + test_analytical_hires(four_1_cell, 1e-7, copy_to_device, copy_to_host); + test_analytical_hires(four_da_1_cell, 1e-6, copy_to_device, copy_to_host); + test_analytical_hires(six_da_1_cell, 1e-6, copy_to_device, copy_to_host); }