From 09c4df23c4042202bb6d87634e4cb5b7720644a4 Mon Sep 17 00:00:00 2001 From: Kyle Shores Date: Mon, 11 Nov 2024 08:40:44 -0600 Subject: [PATCH] uncommenting tests --- .../cuda/test_cuda_analytical_rosenbrock.cpp | 64 ++++++------------- .../jit/test_jit_analytical_rosenbrock.cpp | 60 ++++++----------- .../test_analytical_rosenbrock.cpp | 60 ++++++----------- 3 files changed, 60 insertions(+), 124 deletions(-) diff --git a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp index c64eaf443..28fbdc1e0 100644 --- a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp +++ b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp @@ -144,24 +144,19 @@ TEST(AnalyticalExamplesCudaRosenbrock, BranchedSuperStiffButAnalytical) TEST(AnalyticalExamplesCudaRosenbrock, Robertson) { - auto rosenbrock_solver = [](auto params) - { - return builderType1Cell(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_robertson(solver, 2e-1, copy_to_device, copy_to_host); } @@ -174,75 +169,56 @@ TEST(AnalyticalExamplesCudaRosenbrock, SurfaceRxn) test_analytical_surface_rxn(six_da_1_cell, 1e-7, copy_to_device, copy_to_host); } -//Commented out the following tests as it is failing to copy State to Device -//Will uncomment them once we have a plan how to deal with state (relative tolearnce and absolute tolerance) on GPU -/* TEST(AnalyticalExamplesCudaRosenbrock, E5) { - auto rosenbrock_solver = [](auto params) - { - return builderType1Cell(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_e5(solver, 1e-3, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, Oregonator) { - auto rosenbrock_solver = [](auto params) - { - return builderType1Cell(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_oregonator(solver, 2e-3, copy_to_device, copy_to_host); } TEST(AnalyticalExamplesCudaRosenbrock, HIRES) { - auto rosenbrock_solver = [](auto params) - { - return builderType1Cell(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = builderType1Cell(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_hires(solver, 1e-7, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_hires(solver, 1e-7, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = builderType1Cell(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_hires(solver, 1e-6, copy_to_device, copy_to_host); } -*/ diff --git a/test/integration/jit/test_jit_analytical_rosenbrock.cpp b/test/integration/jit/test_jit_analytical_rosenbrock.cpp index 3792563da..a3dfb903c 100644 --- a/test/integration/jit/test_jit_analytical_rosenbrock.cpp +++ b/test/integration/jit/test_jit_analytical_rosenbrock.cpp @@ -146,24 +146,19 @@ TEST(AnalyticalExamplesJitRosenbrock, BranchedSuperStiffButAnalytical) TEST(AnalyticalExamplesJitRosenbrock, Robertson) { - auto rosenbrock_solver = [](auto params) - { - return BuilderType<1>(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_robertson, StateType<1>>(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_robertson, StateType<1>>(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_robertson, StateType<1>>(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_robertson, StateType<1>>(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_robertson, StateType<1>>(solver, 1e-1); } @@ -178,69 +173,54 @@ TEST(AnalyticalExamplesJitRosenbrock, SurfaceRxn) TEST(AnalyticalExamplesJitRosenbrock, E5) { - auto rosenbrock_solver = [](auto params) - { - return BuilderType<1>(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_e5, StateType<1>>(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_e5, StateType<1>>(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_e5, StateType<1>>(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_e5, StateType<1>>(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_e5, StateType<1>>(solver, 1e-3); } TEST(AnalyticalExamplesJitRosenbrock, Oregonator) { - auto rosenbrock_solver = [](auto params) - { - return BuilderType<1>(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_oregonator, StateType<1>>(solver, 4e-4); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_oregonator, StateType<1>>(solver, 4e-4); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_oregonator, StateType<1>>(solver, 4e-4); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_oregonator, StateType<1>>(solver, 4e-4); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_oregonator, StateType<1>>(solver, 4e-4); } TEST(AnalyticalExamplesJitRosenbrock, HIRES) { - auto rosenbrock_solver = [](auto params) - { - return BuilderType<1>(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType<1>(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_hires, StateType<1>>(solver, 1e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_hires, StateType<1>>(solver, 1e-7); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_hires, StateType<1>>(solver, 1e-7); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_hires, StateType<1>>(solver, 1e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType<1>(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_hires, StateType<1>>(solver, 1e-6); } \ No newline at end of file diff --git a/test/integration/test_analytical_rosenbrock.cpp b/test/integration/test_analytical_rosenbrock.cpp index cba463545..cd6a1bd91 100644 --- a/test/integration/test_analytical_rosenbrock.cpp +++ b/test/integration/test_analytical_rosenbrock.cpp @@ -196,70 +196,55 @@ TEST(AnalyticalExamples, BranchedSuperStiffButAnalytical) TEST(AnalyticalExamples, Robertson) { - auto rosenbrock_solver = [](auto params) - { - return BuilderType(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_robertson(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_robertson(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_robertson(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_robertson(solver, 1e-1); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_robertson(solver, 1e-1); } TEST(AnalyticalExamples, E5) { - auto rosenbrock_solver = [](auto params) - { - return BuilderType(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_e5(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_e5(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_e5(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_e5(solver, 1e-3); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_e5(solver, 1e-3); } TEST(AnalyticalExamples, Oregonator) { - auto rosenbrock_solver = [](auto params) - { - return micm::CpuSolverBuilder(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_oregonator(solver, 4e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_oregonator(solver, 4e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_oregonator(solver, 4e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_oregonator(solver, 4e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_oregonator(solver, 4e-6); } @@ -274,23 +259,18 @@ TEST(AnalyticalExamples, SurfaceRxn) TEST(AnalyticalExamples, HIRES) { - auto rosenbrock_solver = [](auto params) - { - return micm::CpuSolverBuilder(params); - }; - - auto solver = rosenbrock_solver(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); + auto solver = BuilderType(micm::RosenbrockSolverParameters::TwoStageRosenbrockParameters()); test_analytical_hires(solver, 1e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::ThreeStageRosenbrockParameters()); test_analytical_hires(solver, 1e-7); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageRosenbrockParameters()); test_analytical_hires(solver, 1e-7); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::FourStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_hires(solver, 1e-6); - solver = rosenbrock_solver(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); + solver = BuilderType(micm::RosenbrockSolverParameters::SixStageDifferentialAlgebraicRosenbrockParameters()); test_analytical_hires(solver, 1e-6); }