 |
Ginkgo
Generated from pipelines/2662685947 branch based on develop. Ginkgo version 2.0.0
A numerical linear algebra library targeting many-core architectures
|
5 #ifndef GKO_PUBLIC_CORE_STOP_TIME_HPP_
6 #define GKO_PUBLIC_CORE_STOP_TIME_HPP_
11 #include <ginkgo/core/base/abstract_factory.hpp>
12 #include <ginkgo/core/stop/criterion.hpp>
26 using clock = std::chrono::steady_clock;
40 bool check_impl(
uint8 stoppingId,
bool setFinalized,
44 explicit Time(std::shared_ptr<const gko::Executor> exec)
45 :
Criterion(std::move(exec)), time_limit_{}, start_{}
48 explicit Time(
const Factory* factory,
const CriterionArgs args)
50 parameters_{factory->get_parameters()},
51 time_limit_{std::chrono::duration<double>(
52 factory->get_parameters().time_limit)},
62 std::chrono::duration<double> time_limit_;
63 clock::time_point start_;
90 deferred_factory_parameter<Time::Factory>
time_limit(
91 std::chrono::nanoseconds duration);
98 #endif // GKO_PUBLIC_CORE_STOP_TIME_HPP_
deferred_factory_parameter< Time::Factory > time_limit(std::chrono::nanoseconds duration)
Creates the precursor to a Time stopping criterion factory, to be used in conjunction with ....
std::uint8_t uint8
8-bit unsigned integral type.
Definition: types.hpp:119
#define GKO_FACTORY_PARAMETER_SCALAR(_name, _default)
Creates a scalar factory parameter in the factory parameters structure.
Definition: abstract_factory.hpp:437
The Ginkgo namespace.
Definition: abstract_factory.hpp:20
An array is a container which encapsulates fixed-sized arrays, stored on the Executor tied to the arr...
Definition: array.hpp:26
The Time class is a stopping criterion which stops the iteration process after a certain amount of ti...
Definition: time.hpp:24
The Criterion class is a base class for all stopping criteria.
Definition: criterion.hpp:36
The Updater class serves for convenient argument passing to the Criterion's check function.
Definition: criterion.hpp:55
#define GKO_ENABLE_BUILD_METHOD(_factory_name)
Defines a build method for the factory, simplifying its construction by removing the repetitive typin...
Definition: abstract_factory.hpp:386
#define GKO_CREATE_FACTORY_PARAMETERS(_parameters_name, _factory_name)
This Macro will generate a new type containing the parameters for the factory _factory_name.
Definition: abstract_factory.hpp:272
std::shared_ptr< const Executor > get_executor() const noexcept
Returns the Executor of the object.
Definition: polymorphic_object.hpp:62