Skip to content

Commit

Permalink
fix cuda tests
Browse files Browse the repository at this point in the history
  • Loading branch information
montythind committed Oct 2, 2024
1 parent 0904e97 commit f4cf73a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 5 deletions.
2 changes: 1 addition & 1 deletion include/micm/cuda/solver/cuda_rosenbrock.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ namespace micm
/// @return The scaled norm of the errors
template<class DenseMatrixPolicy>
double NormalizedError(const DenseMatrixPolicy& y_old, const DenseMatrixPolicy& y_new, const DenseMatrixPolicy& errors)
const requires(CudaMatrix<DenseMatrixPolicy>&& VectorizableDense<DenseMatrixPolicy>)
const requires(CudaMatrix<DenseMatrixPolicy>&& VectorizableDense<DenseMatrixPolicy>, auto& state)
{
return micm::cuda::NormalizedErrorDriver(
y_old.AsDeviceParam(), y_new.AsDeviceParam(), errors.AsDeviceParam(), this->parameters_, this->devstruct_);
Expand Down
2 changes: 0 additions & 2 deletions test/integration/cuda/test_cuda_analytical_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -146,8 +146,6 @@ TEST(AnalyticalExamplesCudaRosenbrock, Robertson)
{
auto rosenbrock_solver = [](auto params)
{
params.relative_tolerance_ = 1e-10;
params.absolute_tolerance_ = std::vector<double>(3, params.relative_tolerance_ * 1e-2);
return builderType1Cell(params);
};

Expand Down
4 changes: 2 additions & 2 deletions test/unit/cuda/solver/test_cuda_rosenbrock.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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));
Expand Down

0 comments on commit f4cf73a

Please sign in to comment.