Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
gregor.olenik
OGL
Commits
c836294b
Commit
c836294b
authored
Apr 10, 2021
by
Gregor Olenik
Browse files
Move IterationLogger to common.H
parent
5bc19161
Changes
2
Hide whitespace changes
Inline
Side-by-side
common/common.H
View file @
c836294b
...
...
@@ -75,6 +75,28 @@ typedef IOPtr<gko::ReferenceExecutor> GKOReferenceExecPtr;
typedef
IOPtr
<
gko
::
OmpExecutor
>
GKOOmpExecPtr
;
typedef
IOPtr
<
gko
::
HipExecutor
>
GKOHipExecPtr
;
// Logs the number of iteration executed
struct
IterationLogger
:
gko
::
log
::
Logger
{
void
on_iteration_complete
(
const
gko
::
LinOp
*
,
const
gko
::
size_type
&
num_iterations
,
const
gko
::
LinOp
*
residual
,
const
gko
::
LinOp
*
res_norm
,
const
gko
::
LinOp
*
)
const
override
{
this
->
num_iters
=
num_iterations
;
}
IterationLogger
(
std
::
shared_ptr
<
const
gko
::
Executor
>
exec
)
:
exec
(
exec
),
gko
::
log
::
Logger
(
exec
,
gko
::
log
::
Logger
::
iteration_complete_mask
)
{}
gko
::
size_type
get_iters
()
{
return
num_iters
;
}
private:
std
::
shared_ptr
<
const
gko
::
Executor
>
exec
;
mutable
gko
::
size_type
num_iters
{
0
};
};
class
lduLduCommonBase
{
const
objectRegistry
&
db_
;
...
...
lduMatrix/GKOlduBase/GKOlduBase.H
View file @
c836294b
...
...
@@ -38,29 +38,6 @@ SourceFiles
namespace
Foam
{
// Logs the number of iteration executed
struct
IterationLogger
:
gko
::
log
::
Logger
{
void
on_iteration_complete
(
const
gko
::
LinOp
*
,
const
gko
::
size_type
&
num_iterations
,
const
gko
::
LinOp
*
residual
,
const
gko
::
LinOp
*
res_norm
,
const
gko
::
LinOp
*
)
const
override
{
this
->
num_iters
=
num_iterations
;
}
IterationLogger
(
std
::
shared_ptr
<
const
gko
::
Executor
>
exec
)
:
exec
(
exec
),
gko
::
log
::
Logger
(
exec
,
gko
::
log
::
Logger
::
iteration_complete_mask
)
{}
gko
::
size_type
get_iters
()
{
return
num_iters
;
}
private:
std
::
shared_ptr
<
const
gko
::
Executor
>
exec
;
mutable
gko
::
size_type
num_iters
{
0
};
};
/*---------------------------------------------------------------------------*\
Class GKOCG Declaration
\*---------------------------------------------------------------------------*/
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment