From f4cf73afc6bcc784141b590ccd81d11e3026ec7a Mon Sep 17 00:00:00 2001 From: Montek Thind Date: Wed, 2 Oct 2024 11:01:16 -0700 Subject: [PATCH] fix cuda tests --- include/micm/cuda/solver/cuda_rosenbrock.hpp | 2 +- test/integration/cuda/test_cuda_analytical_rosenbrock.cpp | 2 -- test/unit/cuda/solver/test_cuda_rosenbrock.cpp | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/include/micm/cuda/solver/cuda_rosenbrock.hpp b/include/micm/cuda/solver/cuda_rosenbrock.hpp index 2044f97c9..e74a8c0f1 100644 --- a/include/micm/cuda/solver/cuda_rosenbrock.hpp +++ b/include/micm/cuda/solver/cuda_rosenbrock.hpp @@ -116,7 +116,7 @@ namespace micm /// @return The scaled norm of the errors template double NormalizedError(const DenseMatrixPolicy& y_old, const DenseMatrixPolicy& y_new, const DenseMatrixPolicy& errors) - const requires(CudaMatrix&& VectorizableDense) + const requires(CudaMatrix&& VectorizableDense, auto& state) { return micm::cuda::NormalizedErrorDriver( y_old.AsDeviceParam(), y_new.AsDeviceParam(), errors.AsDeviceParam(), this->parameters_, this->devstruct_); diff --git a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp index d1551e98c..09c366e98 100644 --- a/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp +++ b/test/integration/cuda/test_cuda_analytical_rosenbrock.cpp @@ -146,8 +146,6 @@ TEST(AnalyticalExamplesCudaRosenbrock, Robertson) { auto rosenbrock_solver = [](auto params) { - params.relative_tolerance_ = 1e-10; - params.absolute_tolerance_ = std::vector(3, params.relative_tolerance_ * 1e-2); return builderType1Cell(params); }; diff --git a/test/unit/cuda/solver/test_cuda_rosenbrock.cpp b/test/unit/cuda/solver/test_cuda_rosenbrock.cpp index 2492aed2b..412af8745 100644 --- a/test/unit/cuda/solver/test_cuda_rosenbrock.cpp +++ b/test/unit/cuda/solver/test_cuda_rosenbrock.cpp @@ -133,7 +133,7 @@ void testNormalizedErrorConst() y_new.CopyToDevice(); errors.CopyToDevice(); - double error = gpu_solver.solver_.NormalizedError(y_old, y_new, errors); + double error = gpu_solver.solver_.NormalizedError(y_old, y_new, errors, state); auto expected_error = 0.0; for (size_t i = 0; i < state.state_size_; ++i) @@ -192,7 +192,7 @@ void testNormalizedErrorDiff() y_new.CopyToDevice(); errors.CopyToDevice(); - double computed_error = gpu_solver.solver_.NormalizedError(y_old, y_new, errors); + double computed_error = gpu_solver.solver_.NormalizedError(y_old, y_new, errors, state); auto relative_error = std::abs(computed_error - expected_error) / std::max(std::abs(computed_error), std::abs(expected_error));