Skip to content

Commit

Permalink
Add output operator for solver status.
Browse files Browse the repository at this point in the history
  • Loading branch information
jennloe committed Apr 22, 2022
1 parent fdb2c8a commit 3f8c871
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion src/batched/ode/KokkosBatched_ODE_SolverEndStatus.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,23 @@ enum class ODESolverStatus {
NONFINITE_STATE
};

// std::ostream& operator<<(std::ostream& os, ODESolverStatus status);
std::ostream& operator<<(std::ostream & os, ODESolverStatus & status)
{
switch (status) {
case ODESolverStatus::SUCCESS:
os << "Success!";
break;
case ODESolverStatus::FAILED_TO_CONVERGE:
os << "Failed to Converge";
break;
case ODESolverStatus::MINIMUM_TIMESTEP_REACHED:
os << "Minimum Timestep Reached";
break;
case ODESolverStatus::NONFINITE_STATE:
os << "Non-Finite State";
}
return os;
}
} // namespace ODE
} // namespace Experimental
} // namespace KokkosBatched
Expand Down

0 comments on commit 3f8c871

Please sign in to comment.