Record Class Reference#
|
Reference API
|
#include <ginkgo/core/log/record.hpp>
Classes | |
| struct | logged_data |
Public Member Functions | |
| void | on_allocation_started (const Executor *exec, const size_type &num_bytes) const override |
| void | on_allocation_completed (const Executor *exec, const size_type &num_bytes, const uintptr &location) const override |
| void | on_free_started (const Executor *exec, const uintptr &location) const override |
| void | on_free_completed (const Executor *exec, const uintptr &location) const override |
| void | on_copy_started (const Executor *from, const Executor *to, const uintptr &location_from, const uintptr &location_to, const size_type &num_bytes) const override |
| void | on_copy_completed (const Executor *from, const Executor *to, const uintptr &location_from, const uintptr &location_to, const size_type &num_bytes) const override |
| void | on_operation_launched (const Executor *exec, const Operation *operation) const override |
| void | on_operation_completed (const Executor *exec, const Operation *operation) const override |
| void | on_polymorphic_object_create_started (const Executor *exec, const PolymorphicObject *po) const override |
| void | on_polymorphic_object_create_completed (const Executor *exec, const PolymorphicObject *input, const PolymorphicObject *output) const override |
| void | on_polymorphic_object_copy_started (const Executor *exec, const PolymorphicObject *from, const PolymorphicObject *to) const override |
| void | on_polymorphic_object_copy_completed (const Executor *exec, const PolymorphicObject *from, const PolymorphicObject *to) const override |
| void | on_polymorphic_object_move_started (const Executor *exec, const PolymorphicObject *from, const PolymorphicObject *to) const override |
| void | on_polymorphic_object_move_completed (const Executor *exec, const PolymorphicObject *from, const PolymorphicObject *to) const override |
| void | on_polymorphic_object_deleted (const Executor *exec, const PolymorphicObject *po) const override |
| void | on_linop_apply_started (const LinOp *A, const LinOp *b, const LinOp *x) const override |
| void | on_linop_apply_completed (const LinOp *A, const LinOp *b, const LinOp *x) const override |
| void | on_linop_advanced_apply_started (const LinOp *A, const LinOp *alpha, const LinOp *b, const LinOp *beta, const LinOp *x) const override |
| void | on_linop_advanced_apply_completed (const LinOp *A, const LinOp *alpha, const LinOp *b, const LinOp *beta, const LinOp *x) const override |
| void | on_linop_factory_generate_started (const LinOpFactory *factory, const LinOp *input) const override |
| void | on_linop_factory_generate_completed (const LinOpFactory *factory, const LinOp *input, const LinOp *output) const override |
| void | on_criterion_check_started (const stop::Criterion *criterion, const size_type &num_iterations, const LinOp *residual, const LinOp *residual_norm, const LinOp *solution, const uint8 &stopping_id, const bool &set_finalized) const override |
| void | on_criterion_check_completed (const stop::Criterion *criterion, const size_type &num_iterations, const LinOp *residual, const LinOp *residual_norm, const LinOp *implicit_residual_norm_sq, const LinOp *solution, const uint8 &stopping_id, const bool &set_finalized, const array< stopping_status > *status, const bool &one_changed, const bool &all_converged) const override |
| void | on_criterion_check_completed (const stop::Criterion *criterion, const size_type &num_iterations, const LinOp *residual, const LinOp *residual_norm, const LinOp *solution, const uint8 &stopping_id, const bool &set_finalized, const array< stopping_status > *status, const bool &one_changed, const bool &all_converged) const override |
| void | on_iteration_complete (const LinOp *solver, const LinOp *right_hand_side, const LinOp *x, const size_type &num_iterations, const LinOp *residual, const LinOp *residual_norm, const LinOp *implicit_resnorm_sq, const array< stopping_status > *status, bool stopped) const override |
| void | on_iteration_complete (const LinOp *solver, const size_type &num_iterations, const LinOp *residual, const LinOp *solution, const LinOp *residual_norm) const override |
| void | on_iteration_complete (const LinOp *solver, const size_type &num_iterations, const LinOp *residual, const LinOp *solution, const LinOp *residual_norm, const LinOp *implicit_sq_residual_norm) const override |
| const logged_data & | get () const noexcept |
| logged_data & | get () noexcept |
Public Member Functions inherited from gko::log::Logger | |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==0 &&(0< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==1 &&(1< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==2 &&(2< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==3 &&(3< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==4 &&(4< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==5 &&(5< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==6 &&(6< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==7 &&(7< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==8 &&(8< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==9 &&(9< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==10 &&(10< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==11 &&(11< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==12 &&(12< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==13 &&(13< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==14 &&(14< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==15 &&(15< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==16 &&(16< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==17 &&(17< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==18 &&(18< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==19 &&(19< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==20 &&(20< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==21 &&(21< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==22 &&(22< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==23 &&(23< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==24 &&(24< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==25 &&(25< event_count_max)> | on (Params &&... params) const |
| template<size_type Event, typename... Params> | |
| std::enable_if_t< Event==26 &&(26< event_count_max)> | on (Params &&... params) const |
| virtual bool | needs_propagation () const |
Static Public Member Functions | |
| static std::unique_ptr< Record > | create (std::shared_ptr< const Executor > exec, const mask_type &enabled_events=Logger::all_events_mask, size_type max_storage=1) |
| static std::unique_ptr< Record > | create (const mask_type &enabled_events=Logger::all_events_mask, size_type max_storage=1) |
Protected Member Functions | |
| Record (std::shared_ptr< const gko::Executor > exec, const mask_type &enabled_events=Logger::all_events_mask, size_type max_storage=0) | |
| Record (const mask_type &enabled_events=Logger::all_events_mask, size_type max_storage=0) | |
| template<typename deque_type > | |
| void | append_deque (std::deque< deque_type > &deque, deque_type object) const |
Protected Member Functions inherited from gko::log::Logger | |
| virtual void | on_batch_linop_factory_generate_started (const batch::BatchLinOpFactory *factory, const batch::BatchLinOp *input) const |
| virtual void | on_batch_linop_factory_generate_completed (const batch::BatchLinOpFactory *factory, const batch::BatchLinOp *input, const batch::BatchLinOp *output) const |
| virtual void | on_batch_solver_completed (const array< int > &iters, const array< double > &residual_norms) const |
| virtual void | on_batch_solver_completed (const array< int > &iters, const array< float > &residual_norms) const |
| virtual void | on_batch_solver_completed (const array< int > &iters, const array< gko::half > &residual_norms) const |
| Logger (std::shared_ptr< const gko::Executor > exec, const mask_type &enabled_events=all_events_mask) | |
| Logger (const mask_type &enabled_events=all_events_mask) | |
Additional Inherited Members | |
Public Types inherited from gko::log::Logger | |
| using | mask_type = gko::uint64 |
Static Public Attributes inherited from gko::log::Logger | |
| static constexpr size_type | event_count_max = sizeof(mask_type) * byte_size |
| static constexpr mask_type | all_events_mask = ~mask_type{0} |
| static constexpr size_type | allocation_started { 0 } |
| static constexpr mask_type | allocation_started_mask {mask_type{1} << 0 } |
| static constexpr size_type | allocation_completed { 1 } |
| static constexpr mask_type | allocation_completed_mask {mask_type{1} << 1 } |
| static constexpr size_type | free_started { 2 } |
| static constexpr mask_type | free_started_mask {mask_type{1} << 2 } |
| static constexpr size_type | free_completed { 3 } |
| static constexpr mask_type | free_completed_mask {mask_type{1} << 3 } |
| static constexpr size_type | copy_started { 4 } |
| static constexpr mask_type | copy_started_mask {mask_type{1} << 4 } |
| static constexpr size_type | copy_completed { 5 } |
| static constexpr mask_type | copy_completed_mask {mask_type{1} << 5 } |
| static constexpr size_type | operation_launched { 6 } |
| static constexpr mask_type | operation_launched_mask {mask_type{1} << 6 } |
| static constexpr size_type | operation_completed { 7 } |
| static constexpr mask_type | operation_completed_mask {mask_type{1} << 7 } |
| static constexpr size_type | polymorphic_object_create_started { 8 } |
| static constexpr mask_type | polymorphic_object_create_started_mask {mask_type{1} << 8 } |
| static constexpr size_type | polymorphic_object_create_completed { 9 } |
| static constexpr mask_type | polymorphic_object_create_completed_mask {mask_type{1} << 9 } |
| static constexpr size_type | polymorphic_object_copy_started { 10 } |
| static constexpr mask_type | polymorphic_object_copy_started_mask {mask_type{1} << 10 } |
| static constexpr size_type | polymorphic_object_copy_completed { 11 } |
| static constexpr mask_type | polymorphic_object_copy_completed_mask {mask_type{1} << 11 } |
| static constexpr size_type | polymorphic_object_deleted { 12 } |
| static constexpr mask_type | polymorphic_object_deleted_mask {mask_type{1} << 12 } |
| static constexpr size_type | linop_apply_started { 13 } |
| static constexpr mask_type | linop_apply_started_mask {mask_type{1} << 13 } |
| static constexpr size_type | linop_apply_completed { 14 } |
| static constexpr mask_type | linop_apply_completed_mask {mask_type{1} << 14 } |
| static constexpr size_type | linop_advanced_apply_started { 15 } |
| static constexpr mask_type | linop_advanced_apply_started_mask {mask_type{1} << 15 } |
| static constexpr size_type | linop_advanced_apply_completed { 16 } |
| static constexpr mask_type | linop_advanced_apply_completed_mask {mask_type{1} << 16 } |
| static constexpr size_type | linop_factory_generate_started { 17 } |
| static constexpr mask_type | linop_factory_generate_started_mask {mask_type{1} << 17 } |
| static constexpr size_type | linop_factory_generate_completed { 18 } |
| static constexpr mask_type | linop_factory_generate_completed_mask {mask_type{1} << 18 } |
| static constexpr size_type | criterion_check_started { 19 } |
| static constexpr mask_type | criterion_check_started_mask {mask_type{1} << 19 } |
| static constexpr size_type | criterion_check_completed { 20 } |
| static constexpr mask_type | criterion_check_completed_mask {mask_type{1} << 20 } |
| static constexpr size_type | iteration_complete {21} |
| static constexpr mask_type | iteration_complete_mask {mask_type{1} << 21} |
| static constexpr size_type | polymorphic_object_move_started { 22 } |
| static constexpr mask_type | polymorphic_object_move_started_mask {mask_type{1} << 22 } |
| static constexpr size_type | polymorphic_object_move_completed { 23 } |
| static constexpr mask_type | polymorphic_object_move_completed_mask {mask_type{1} << 23 } |
| static constexpr size_type | batch_linop_factory_generate_started { 24 } |
| static constexpr mask_type | batch_linop_factory_generate_started_mask {mask_type{1} << 24 } |
| static constexpr size_type | batch_linop_factory_generate_completed { 25 } |
| static constexpr mask_type | batch_linop_factory_generate_completed_mask {mask_type{1} << 25 } |
| static constexpr size_type | batch_solver_completed {26} |
| static constexpr mask_type | batch_solver_completed_mask {mask_type{1} << 26} |
| static constexpr mask_type | executor_events_mask |
| static constexpr mask_type | operation_events_mask |
| static constexpr mask_type | polymorphic_object_events_mask |
| static constexpr mask_type | linop_events_mask |
| static constexpr mask_type | linop_factory_events_mask |
| static constexpr mask_type | batch_linop_factory_events_mask |
| static constexpr mask_type | criterion_events_mask |
Detailed Description
Record is a Logger which logs every event to an object. The object can then be accessed at any time by asking the logger to return it.
- Note
- Please note that this logger can have significant memory and performance overhead. In particular, when logging events such as the
checkevents, all parameters are cloned. If it is sufficient to clone one parameter, consider implementing a specific logger for this. In addition, it is advised to tune the history size in order to control memory overhead.
Constructor & Destructor Documentation
◆ Record() [1/2]
|
inlineexplicitprotected |
Creates a Record logger.
- Parameters
-
exec the executor enabled_events the events enabled for this logger. By default all events. max_storage the size of storage (i.e. history) wanted by the user. By default 0 is used, which means unlimited storage. It is advised to control this to reduce memory overhead of this logger.
◆ Record() [2/2]
|
inlineexplicitprotected |
Creates a Record logger.
- Parameters
-
enabled_events the events enabled for this logger. By default all events. max_storage the size of storage (i.e. history) wanted by the user. By default 0 is used, which means unlimited storage. It is advised to control this to reduce memory overhead of this logger.
Member Function Documentation
◆ append_deque()
|
inlineprotected |
Helper function which appends an object to a deque
- Template Parameters
-
deque_type the type of objects in the deque
- Parameters
-
deque the deque to append the object to object the object to append
◆ create() [1/2]
|
inlinestatic |
Creates a Record logger. This dynamically allocates the memory, constructs the object and returns an std::unique_ptr to this object.
- Parameters
-
exec the executor enabled_events the events enabled for this logger. By default all events. max_storage the size of storage (i.e. history) wanted by the user. By default 0 is used, which means unlimited storage. It is advised to control this to reduce memory overhead of this logger.
- Returns
- an std::unique_ptr to the the constructed object
◆ create() [2/2]
|
inlinestatic |
Creates a Record logger. This dynamically allocates the memory, constructs the object and returns an std::unique_ptr to this object.
- Parameters
-
exec the executor enabled_events the events enabled for this logger. By default all events. max_storage the size of storage (i.e. history) wanted by the user. By default 0 is used, which means unlimited storage. It is advised to control this to reduce memory overhead of this logger.
- Returns
- an std::unique_ptr to the the constructed object
◆ get() [1/2]
|
inlinenoexcept |
Returns the logged data
- Returns
- the logged data
◆ get() [2/2]
|
inlinenoexcept |
◆ on_allocation_completed()
|
overridevirtual |
Executor's allocation completed event.
- Parameters
-
exec the executor used num_bytes the number of bytes allocated location the address at which the data was allocated
Reimplemented from gko::log::Logger.
◆ on_allocation_started()
|
overridevirtual |
Executor's allocation started event.
- Parameters
-
exec the executor used num_bytes the number of bytes to allocate
Reimplemented from gko::log::Logger.
◆ on_copy_completed()
|
overridevirtual |
Executor's copy completed event.
- Parameters
-
exec_from the executor copied from exec_to the executor copied to loc_from the address at which the data was copied from loc_to the address at which the data was copied to num_bytes the number of bytes copied
Reimplemented from gko::log::Logger.
◆ on_copy_started()
|
overridevirtual |
Executor's copy started event.
- Parameters
-
exec_from the executor to be copied from exec_to the executor to be copied to loc_from the address at which the data will be copied from loc_to the address at which the data will be copied to num_bytes the number of bytes to be copied
Reimplemented from gko::log::Logger.
◆ on_criterion_check_completed() [1/2]
|
overridevirtual |
stop::Criterion's check completed event. Parameters are the Criterion, the stoppingId, the finalized boolean, the stopping status, plus the output one_changed boolean and output all_converged boolean.
- Parameters
-
criterion the criterion used it the current iteration count r the residual tau the residual norm implicit_tau_sq the implicit residual norm squared x the solution stopping_id the id of the stopping criterion set_finalized whether this finalizes the iteration status the stopping status of the right hand sides one_changed whether at least one right hand side converged or not all_converged whether all right hand sides are converged
Reimplemented from gko::log::Logger.
◆ on_criterion_check_completed() [2/2]
|
overridevirtual |
stop::Criterion's check completed event. Parameters are the Criterion, the stoppingId, the finalized boolean, the stopping status, plus the output one_changed boolean and output all_converged boolean.
- Parameters
-
criterion the criterion used it the current iteration count r the residual tau the residual norm x the solution stopping_id the id of the stopping criterion set_finalized whether this finalizes the iteration status the stopping status of the right hand sides one_changed whether at least one right hand side converged or not all_converged whether all right hand sides
- Note
- The on_criterion_check_completed function that this macro declares is deprecated. Please use the one with the additional implicit_tau_sq parameter as below.
Reimplemented from gko::log::Logger.
◆ on_criterion_check_started()
|
overridevirtual |
stop::Criterion's check started event.
- Parameters
-
criterion the criterion used it the current iteration count r the residual tau the residual norm x the solution stopping_id the id of the stopping criterion set_finalized whether this finalizes the iteration
Reimplemented from gko::log::Logger.
◆ on_free_completed()
|
overridevirtual |
Executor's free completed event.
- Parameters
-
exec the executor used location the address at which the data was freed
Reimplemented from gko::log::Logger.
◆ on_free_started()
|
overridevirtual |
Executor's free started event.
- Parameters
-
exec the executor used location the address at which the data will be freed
Reimplemented from gko::log::Logger.
◆ on_iteration_complete() [1/3]
|
overridevirtual |
Register the iteration_complete event which logs every completed iterations.
- Parameters
-
solver the solver executing the iteration b the right-hand-side vector x the solution vector it the current iteration count r the residual (optional) tau the implicit residual norm squared (optional) implicit_tau_sq the residual norm (optional) status the stopping status of the right hand sides (optional) stopped whether all right hand sides have stopped (invalid if status is not provided)
Reimplemented from gko::log::Logger.
◆ on_iteration_complete() [2/3]
|
overridevirtual |
Register the iteration_complete event which logs every completed iterations.
- Parameters
-
it the current iteration count r the residual x the solution vector (optional) tau the residual norm (optional)
- Warning
- This on_iteration_complete function that this macro declares is deprecated. Please use the version with the stopping information.
Reimplemented from gko::log::Logger.
◆ on_iteration_complete() [3/3]
|
overridevirtual |
Register the iteration_complete event which logs every completed iterations.
- Parameters
-
it the current iteration count r the residual x the solution vector (optional) tau the residual norm (optional) implicit_tau_sq the implicit residual norm squared (optional)
- Warning
- This on_iteration_complete function that this macro declares is deprecated. Please use the version with the stopping information.
Reimplemented from gko::log::Logger.
◆ on_linop_advanced_apply_completed()
|
overridevirtual |
LinOp's advanced apply completed event.
- Parameters
-
A the system matrix alpha scaling of the result of op(b) b the input vector(s) beta scaling of the input x x the output vector(s)
Reimplemented from gko::log::Logger.
◆ on_linop_advanced_apply_started()
|
overridevirtual |
LinOp's advanced apply started event.
- Parameters
-
A the system matrix alpha scaling of the result of op(b) b the input vector(s) beta scaling of the input x x the output vector(s)
Reimplemented from gko::log::Logger.
◆ on_linop_apply_completed()
|
overridevirtual |
LinOp's apply completed event.
- Parameters
-
A the system matrix b the input vector(s) x the output vector(s)
Reimplemented from gko::log::Logger.
◆ on_linop_apply_started()
|
overridevirtual |
LinOp's apply started event.
- Parameters
-
A the system matrix b the input vector(s) x the output vector(s)
Reimplemented from gko::log::Logger.
◆ on_linop_factory_generate_completed()
|
overridevirtual |
LinOp Factory's generate completed event.
- Parameters
-
factory the factory used input the LinOp object used as input for the generation (usually a system matrix) output the generated LinOp object
Reimplemented from gko::log::Logger.
◆ on_linop_factory_generate_started()
|
overridevirtual |
LinOp Factory's generate started event.
- Parameters
-
factory the factory used input the LinOp object used as input for the generation (usually a system matrix)
Reimplemented from gko::log::Logger.
◆ on_operation_completed()
|
overridevirtual |
Executor's operation completed event (method run).
- Parameters
-
exec the executor used op the completed operation
- Note
- For the GPU, to be certain that the operation completed it is required to call synchronize. This burden falls on the logger. Most of the loggers will do lightweight logging, and therefore this operation for the GPU just notes that the Operation has been sent to the GPU.
Reimplemented from gko::log::Logger.
◆ on_operation_launched()
|
overridevirtual |
Executor's operation launched event (method run).
- Parameters
-
exec the executor used op the operation launched
Reimplemented from gko::log::Logger.
◆ on_polymorphic_object_copy_completed()
|
overridevirtual |
PolymorphicObject's copy completed event.
- Parameters
-
exec the executor used input the PolymorphicObject to be copied from output the PolymorphicObject to be copied to
Reimplemented from gko::log::Logger.
◆ on_polymorphic_object_copy_started()
|
overridevirtual |
PolymorphicObject's copy started event.
- Parameters
-
exec the executor used input the PolymorphicObject to be copied from output the PolymorphicObject to be copied to
Reimplemented from gko::log::Logger.
◆ on_polymorphic_object_create_completed()
|
overridevirtual |
PolymorphicObject's create completed event.
- Parameters
-
exec the executor used input the PolymorphicObject used as model for the creation output the PolymorphicObject which was created
Reimplemented from gko::log::Logger.
◆ on_polymorphic_object_create_started()
|
overridevirtual |
PolymorphicObject's create started event.
- Parameters
-
exec the executor used po the PolymorphicObject to be created
Reimplemented from gko::log::Logger.
◆ on_polymorphic_object_deleted()
|
overridevirtual |
PolymorphicObject's deleted event.
- Parameters
-
exec the executor used po the PolymorphicObject to be deleted
Reimplemented from gko::log::Logger.
◆ on_polymorphic_object_move_completed()
|
overridevirtual |
PolymorphicObject's move completed event.
- Parameters
-
exec the executor used input the PolymorphicObject to be move from output the PolymorphicObject to be move into
Reimplemented from gko::log::Logger.
◆ on_polymorphic_object_move_started()
|
overridevirtual |
PolymorphicObject's move started event.
- Parameters
-
exec the executor used input the PolymorphicObject to be move from output the PolymorphicObject to be move into
Reimplemented from gko::log::Logger.
The documentation for this class was generated from the following file:
- ginkgo/core/log/record.hpp
Generated by
Public Member Functions inherited from