Skip to content

Commit

Permalink
simplifying cuda analytical test interface
Browse files Browse the repository at this point in the history
  • Loading branch information
K20shores committed Nov 11, 2024
1 parent 59460c6 commit 4b81426
Showing 1 changed file with 24 additions and 60 deletions.
84 changes: 24 additions & 60 deletions test/integration/cuda/test_cuda_analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,24 +142,6 @@ TEST(AnalyticalExamplesCudaRosenbrock, BranchedSuperStiffButAnalytical)
test_analytical_stiff_branched<builderType, stateType>(six_da, 2e-3, copy_to_device, copy_to_host);
}

TEST(AnalyticalExamplesCudaRosenbrock, Robertson)
{
auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_robertson<builderType1Cell, stateType1Cell>(solver, 2e-1, copy_to_device, copy_to_host);
}

TEST(AnalyticalExamplesCudaRosenbrock, SurfaceRxn)
{
test_analytical_surface_rxn<builderType1Cell, stateType1Cell>(two_1_cell, 1e-2, copy_to_device, copy_to_host);
Expand All @@ -169,56 +151,38 @@ TEST(AnalyticalExamplesCudaRosenbrock, SurfaceRxn)
test_analytical_surface_rxn<builderType1Cell, stateType1Cell>(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<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);
test_analytical_robertson<builderType1Cell, stateType1Cell>(two_1_cell, 2e-1, copy_to_device, copy_to_host);
test_analytical_robertson<builderType1Cell, stateType1Cell>(three_1_cell, 2e-1, copy_to_device, copy_to_host);
test_analytical_robertson<builderType1Cell, stateType1Cell>(four_1_cell, 2e-1, copy_to_device, copy_to_host);
test_analytical_robertson<builderType1Cell, stateType1Cell>(four_da_1_cell, 2e-1, copy_to_device, copy_to_host);
test_analytical_robertson<builderType1Cell, stateType1Cell>(six_da_1_cell, 2e-1, copy_to_device, copy_to_host);
}

solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_e5<builderType1Cell, stateType1Cell>(solver, 1e-3, copy_to_device, copy_to_host);
TEST(AnalyticalExamplesCudaRosenbrock, E5)
{
test_analytical_e5<builderType1Cell, stateType1Cell>(two_1_cell, 1e-3, copy_to_device, copy_to_host);
test_analytical_e5<builderType1Cell, stateType1Cell>(three_1_cell, 1e-3, copy_to_device, copy_to_host);
test_analytical_e5<builderType1Cell, stateType1Cell>(four_1_cell, 1e-3, copy_to_device, copy_to_host);
test_analytical_e5<builderType1Cell, stateType1Cell>(four_da_1_cell, 1e-3, copy_to_device, copy_to_host);
test_analytical_e5<builderType1Cell, stateType1Cell>(six_da_1_cell, 1e-3, copy_to_device, copy_to_host);
}

TEST(AnalyticalExamplesCudaRosenbrock, Oregonator)
{
auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_oregonator<builderType1Cell, stateType1Cell>(solver, 2e-3, copy_to_device, copy_to_host);
test_analytical_oregonator<builderType1Cell, stateType1Cell>(two_1_cell, 2e-3, copy_to_device, copy_to_host);
test_analytical_oregonator<builderType1Cell, stateType1Cell>(three_1_cell, 2e-3, copy_to_device, copy_to_host);
test_analytical_oregonator<builderType1Cell, stateType1Cell>(four_1_cell, 2e-3, copy_to_device, copy_to_host);
test_analytical_oregonator<builderType1Cell, stateType1Cell>(four_da_1_cell, 2e-3, copy_to_device, copy_to_host);
test_analytical_oregonator<builderType1Cell, stateType1Cell>(six_da_1_cell, 2e-3, copy_to_device, copy_to_host);
}

TEST(AnalyticalExamplesCudaRosenbrock, HIRES)
{
auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-6, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-7, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-7, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-6, copy_to_device, copy_to_host);

solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters());
test_analytical_hires<builderType1Cell, stateType1Cell>(solver, 1e-6, copy_to_device, copy_to_host);
test_analytical_hires<builderType1Cell, stateType1Cell>(two_1_cell, 1e-6, copy_to_device, copy_to_host);
test_analytical_hires<builderType1Cell, stateType1Cell>(three_1_cell, 1e-7, copy_to_device, copy_to_host);
test_analytical_hires<builderType1Cell, stateType1Cell>(four_1_cell, 1e-7, copy_to_device, copy_to_host);
test_analytical_hires<builderType1Cell, stateType1Cell>(four_da_1_cell, 1e-6, copy_to_device, copy_to_host);
test_analytical_hires<builderType1Cell, stateType1Cell>(six_da_1_cell, 1e-6, copy_to_device, copy_to_host);
}

0 comments on commit 4b81426

Please sign in to comment.