Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove unnecessary semicolons in source code #131

Merged
merged 4 commits into from
Jun 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions BaseWrapper/lduBase/GKOlduBase.H
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ namespace Foam {
\
if (precond != NULL) return create_precond(exec, precond); \
return create_default(exec); \
};
}


template <class SolverFactory>
Expand All @@ -50,14 +50,15 @@ public:
const dictionary &solverControls)
: lduLduBase<lduMatrix, SolverFactory>(
fieldName, matrix, interfaceBouCoeffs, interfaceIntCoeffs,
interfaces, solverControls){};
interfaces, solverControls)
{}

virtual solverPerformance solve_impl(word typeName, scalarField &psi,
const scalarField &source,
const direction cmpt = 0) const
{
return this->solve_impl_(typeName, psi, source, cmpt);
};
}
};

// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Expand Down
1 change: 0 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ SPDX-License-Identifier: GPL-3.0-or-later
- Add a warning message to users who use dpcpp as the executor name [PR #129](https://github.com/hpsim/OGL/pull/129)
- Add support for SP scalars and determine label and scalar size from env variable [PR #120](https://github.com/hpsim/OGL/pull/120)
- Notify user of a unsupported executor argument [PR #118](https://github.com/hpsim/OGL/pull/118)
- Notify user of a unsupported executor argument [PR #]
- Add a list of all OGL authors [PR #126](https://github.com/hpsim/OGL/pull/126)
- Replace #ifdef include guard with #pragma once [PR #126](https://github.com/hpsim/OGL/pull/126)
- Switch to SPDX headers, fix formatting issue[PR #122](https://github.com/hpsim/OGL/pull/112)
Expand Down
7 changes: 2 additions & 5 deletions DevicePersistent/Array/Array.H
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,12 @@ public:

T *get_data() const { return this->get_persistent_object()->get_data(); }

void set_data(T *data)
{
this->get_persistent_object()->get_data() = data;
};
void set_data(T *data) { this->get_persistent_object()->get_data() = data; }

const T *get_const_data() const
{
return this->get_persistent_object()->get_const_data();
};
}


std::shared_ptr<gko::array<T>> get_array() const
Expand Down
7 changes: 4 additions & 3 deletions DevicePersistent/Base/Base.H
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,13 @@ public:

//- Construct from IOobject and a PtrList
DevicePersistentBase(const IOobject &io, std::shared_ptr<T> in_ptr)
: regIOobject(io), ptr_(in_ptr){};
: regIOobject(io), ptr_(in_ptr)
{}

// get a ptr to the underlying data
std::shared_ptr<T> get_ptr() { return ptr_; };
std::shared_ptr<T> get_ptr() { return ptr_; }

bool writeData(Ostream &) const { return false; };
bool writeData(Ostream &) const { return false; }
};

/* Base class for storing ginkgo and OGL data structures in the Objectregistry
Expand Down
6 changes: 3 additions & 3 deletions DevicePersistent/ExecutorHandler/ExecutorHandler.H
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ struct ExecutorInitFunctor {
<< "CUDA Backend was not compiled. Recompile OGL/Ginkgo "
"with CUDA backend enabled."
<< abort(FatalError);
};
}

return gko::share(gko::CudaExecutor::create(
device_id_ % gko::CudaExecutor::get_num_devices(), host_exec));
Expand All @@ -62,7 +62,7 @@ struct ExecutorInitFunctor {
<< "SYCL Backend was not compiled. Recompile OGL/Ginkgo "
"with SYCL backend enabled."
<< abort(FatalError);
};
}

if (executor_name_ == "dpcpp") {
Info << "Warning: the executor name dpcpp is deprecated.\n"
Expand All @@ -85,7 +85,7 @@ struct ExecutorInitFunctor {
<< "HIP Backend was not compiled. Recompile OGL/Ginkgo "
"with HIP backend enabled."
<< abort(FatalError);
};
}
auto ret = gko::share(gko::HipExecutor::create(
device_id_ % gko::HipExecutor::get_num_devices(), host_exec));
return ret;
Expand Down
7 changes: 2 additions & 5 deletions DevicePersistent/Vector/Vector.H
Original file line number Diff line number Diff line change
Expand Up @@ -181,15 +181,12 @@ public:

T *get_data() const { return this->get_persistent_object()->get_data(); }

void set_data(T *data)
{
this->get_persistent_object()->get_data() = data;
};
void set_data(T *data) { this->get_persistent_object()->get_data() = data; }

const T *get_const_data() const
{
return this->get_persistent_object()->get_const_data();
};
}

const ExecutorHandler &get_exec_handler() const { return exec_; }

Expand Down
12 changes: 6 additions & 6 deletions HostMatrix/HostMatrix.H
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ public:
const CommunicationPattern &get_communication_pattern() const
{
return communication_pattern_;
};
}

label get_local_nrows() const { return nrows_; }

Expand All @@ -416,27 +416,27 @@ public:
PersistentArray<label> &get_local_col_idxs() const
{
return local_sparsity_.col_idxs_;
};
}

PersistentArray<label> &get_local_row_idxs() const
{
return local_sparsity_.row_idxs_;
};
}

PersistentArray<scalar> &get_non_local_coeffs() const
{
return non_local_coeffs_;
};
}

PersistentArray<label> &get_non_local_col_idxs() const
{
return non_local_sparsity_.col_idxs_;
};
}

PersistentArray<label> &get_non_local_row_idxs() const
{
return non_local_sparsity_.row_idxs_;
};
}
};


Expand Down
6 changes: 3 additions & 3 deletions LduMatrix/GKOACG/GKOACG.H
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ public:
if (preconditioner_ == "none")
return create_default(exec, criterion_vec);
if (preconditioner_ == "BJ") return create_BJ(exec, criterion_vec);
};
}

std::unique_ptr<gko::solver::Cg<double>::Factory,
std::default_delete<gko::solver::Cg<double>::Factory>>
Expand All @@ -51,7 +51,7 @@ public:
return gko::solver::Cg<scalar>::build()
.with_criteria(criterion_vec)
.on(exec);
};
}

std::unique_ptr<gko::solver::Cg<double>::Factory,
std::default_delete<gko::solver::Cg<double>::Factory>>
Expand All @@ -64,7 +64,7 @@ public:
.with_criteria(criterion_vec)
.with_preconditioner(bj::build().with_max_block_size(8u).on(exec))
.on(exec);
};
}
};

/*---------------------------------------------------------------------------*\
Expand Down
2 changes: 1 addition & 1 deletion Preconditioner/Preconditioner.H
Original file line number Diff line number Diff line change
Expand Up @@ -428,6 +428,6 @@ public:
po->get_ptr();

return generated_precond;
};
}
};
} // namespace Foam
9 changes: 5 additions & 4 deletions Solver/BiCGStab/GKOBiCGStab.H
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ public:
: solverControls_(solverControls),
db_(db),
sysMatrixName_(sysMatrixName),
stoppingCriterion_(solverControls){};
stoppingCriterion_(solverControls)
{}

CREATE_SOLVER_METHODS(bicgstab)

Expand All @@ -52,7 +53,7 @@ public:
.with_criteria(stoppingCriterionVec_)
.on(exec);
return bicgstab;
};
}

std::unique_ptr<bicgstab::Factory, std::default_delete<bicgstab::Factory>>
create_precond(std::shared_ptr<gko::Executor> exec,
Expand All @@ -63,7 +64,7 @@ public:
.with_generated_preconditioner(precond)
.on(exec);
return bicgstab;
};
}

scalar get_init_res_norm() const
{
Expand Down Expand Up @@ -140,7 +141,7 @@ public:
interfaceIntCoeffs, interfaces, solverControls){};

//- Destructor
virtual ~GKOBiCGStab(){};
virtual ~GKOBiCGStab() {}


// Member Functions
Expand Down
12 changes: 7 additions & 5 deletions Solver/CG/GKOCG.H
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ public:
: solverControls_(solverControls),
db_(db),
sysMatrixName_(sysMatrixName),
stoppingCriterion_(solverControls){};
stoppingCriterion_(solverControls)
{}

CREATE_SOLVER_METHODS(cg)

Expand All @@ -46,7 +47,7 @@ public:
{
auto cg = cg::build().with_criteria(stoppingCriterionVec_).on(exec);
return cg;
};
}

std::unique_ptr<cg::Factory, std::default_delete<cg::Factory>>
create_precond(std::shared_ptr<gko::Executor> exec,
Expand All @@ -57,7 +58,7 @@ public:
.with_generated_preconditioner(precond)
.on(exec);
return cg;
};
}

scalar get_init_res_norm() const
{
Expand Down Expand Up @@ -134,10 +135,11 @@ public:
const lduInterfaceFieldPtrsList &interfaces,
const dictionary &solverControls)
: GKOlduBaseSolver(fieldName, matrix, interfaceBouCoeffs,
interfaceIntCoeffs, interfaces, solverControls){};
interfaceIntCoeffs, interfaces, solverControls)
{}

//- Destructor
virtual ~GKOCG(){};
virtual ~GKOCG() {}


// Member Functions
Expand Down
12 changes: 7 additions & 5 deletions Solver/GMRES/GKOGMRES.H
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ public:
: solverControls_(solverControls),
db_(db),
sysMatrixName_(sysMatrixName),
stoppingCriterion_(solverControls){};
stoppingCriterion_(solverControls)
{}

CREATE_SOLVER_METHODS(gmres)

Expand All @@ -48,7 +49,7 @@ public:
auto gmres =
gmres::build().with_criteria(stoppingCriterionVec_).on(exec);
return gmres;
};
}

std::unique_ptr<gmres::Factory, std::default_delete<gmres::Factory>>
create_precond(std::shared_ptr<gko::Executor> exec,
Expand All @@ -59,7 +60,7 @@ public:
.with_generated_preconditioner(precond)
.on(exec);
return gmres;
};
}

scalar get_init_res_norm() const
{
Expand Down Expand Up @@ -137,10 +138,11 @@ public:
const lduInterfaceFieldPtrsList &interfaces,
const dictionary &solverControls)
: GKOlduBaseSolver(fieldName, matrix, interfaceBouCoeffs,
interfaceIntCoeffs, interfaces, solverControls){};
interfaceIntCoeffs, interfaces, solverControls)
{}

//- Destructor
virtual ~GKOGMRES(){};
virtual ~GKOGMRES() {}


// Member Functions
Expand Down
12 changes: 7 additions & 5 deletions Solver/IR/GKOIR.H
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,8 @@ public:
db_(db),
sysMatrixName_(sysMatrixName),
outerStoppingCriterion_(solverControls),
innerStoppingCriterion_(StoppingCriterion(innerSolverControls_)){};
innerStoppingCriterion_(StoppingCriterion(innerSolverControls_))
{}

CREATE_SOLVER_METHODS(ir)

Expand All @@ -73,7 +74,7 @@ public:
.on(exec);

return ir;
};
}

std::unique_ptr<gko::solver::Ir<scalar>::Factory,
std::default_delete<gko::solver::Ir<scalar>::Factory>>
Expand All @@ -97,7 +98,7 @@ public:
.on(exec);

return ir;
};
}

scalar get_init_res_norm() const
{
Expand Down Expand Up @@ -161,10 +162,11 @@ public:
const lduInterfaceFieldPtrsList &interfaces,
const dictionary &solverControls)
: GKOlduBaseSolver(fieldName, matrix, interfaceBouCoeffs,
interfaceIntCoeffs, interfaces, solverControls){};
interfaceIntCoeffs, interfaces, solverControls)
{}

//- Destructor
virtual ~GKOIR(){};
virtual ~GKOIR() {}


// Member Functions
Expand Down
14 changes: 8 additions & 6 deletions Solver/Multigrid/GKOMultigrid.H
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,9 @@ public:
innerSolverControls_.lookupOrDefault("coarseMaxIters", label(4))),
max_levels_(
innerSolverControls_.lookupOrDefault("maxLevels", label(9))),
min_coarse_rows_(innerSolverControls_.lookupOrDefault("minCoarseRows",
label(10))){};
min_coarse_rows_(
innerSolverControls_.lookupOrDefault("minCoarseRows", label(10)))
{}

std::unique_ptr<mg::Factory, std::default_delete<mg::Factory>>
create_dist_solver(std::shared_ptr<gko::Executor> exec,
Expand Down Expand Up @@ -139,7 +140,7 @@ public:
.on(exec);

return ret;
};
}

// Create solver
std::unique_ptr<mg::Factory, std::default_delete<mg::Factory>>
Expand Down Expand Up @@ -195,7 +196,7 @@ public:
.on(exec);

return ret;
};
}

scalar get_init_res_norm() const
{
Expand Down Expand Up @@ -258,10 +259,11 @@ public:
const lduInterfaceFieldPtrsList &interfaces,
const dictionary &solverControls)
: GKOlduBaseSolver(fieldName, matrix, interfaceBouCoeffs,
interfaceIntCoeffs, interfaces, solverControls){};
interfaceIntCoeffs, interfaces, solverControls)
{}

//- Destructor
virtual ~GKOMultigrid(){};
virtual ~GKOMultigrid() {}


// Member Functions
Expand Down
Loading