Merge pull request #5513 from akva2/janitoring_clang

Quell some clang warnings
This commit is contained in:
Bård Skaflestad 2024-08-07 12:47:54 +02:00 committed by GitHub
commit 4cbc82867b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
6 changed files with 26 additions and 23 deletions

View File

@ -24,6 +24,8 @@
#include <opm/simulators/linalg/bda/opencl/opencl.hpp>
#endif
#include <memory>
namespace Opm::Accelerator {
enum PreconditionerType {

View File

@ -20,14 +20,14 @@
#ifndef OPM_OPENCLBILU0_HPP
#define OPM_OPENCLBILU0_HPP
#include <mutex>
#include <opm/simulators/linalg/bda/BlockedMatrix.hpp>
#include <opm/simulators/linalg/bda/opencl/opencl.hpp>
#include <opm/simulators/linalg/bda/opencl/openclPreconditioner.hpp>
#include <opm/simulators/linalg/bda/opencl/ChowPatelIlu.hpp>
#include <memory>
#include <mutex>
namespace Opm::Accelerator {
@ -103,7 +103,7 @@ public:
// via Lz = y
// and Ux = z
void apply(const cl::Buffer& y, cl::Buffer& x) override;
void apply(Scalar&, Scalar&) {}
void apply(Scalar&, Scalar&) override {}
std::tuple<std::vector<int>, std::vector<int>, std::vector<int>>
get_preconditioner_structure()

View File

@ -125,7 +125,7 @@ public:
// apply preconditioner, x = prec(y)
void apply(const cl::Buffer& y, cl::Buffer& x) override;
void apply(Scalar&, Scalar&) {}
void apply(Scalar&, Scalar&) override {}
};
/// Similar function to csrPatternToCsc. It gives an offset map from CSR to CSC instead of the full CSR to CSC conversion.

View File

@ -95,7 +95,7 @@ public:
// applies blocked ilu0
// also applies amg for pressure component
void apply(const cl::Buffer& y, cl::Buffer& x) override;
void apply(Scalar&, Scalar&) {}
void apply(Scalar&, Scalar&) override {}
bool create_preconditioner(BlockedMatrix<Scalar>* mat) override;
bool create_preconditioner(BlockedMatrix<Scalar>* mat,

View File

@ -25,13 +25,22 @@
#include <bitset>
#include <cstdint>
#include <ctime>
#include <stdexcept>
#include <string>
#include <type_traits>
namespace Opm {
namespace Mpi {
namespace detail {
namespace Opm::Mpi::detail {
std::size_t mpi_buffer_size(const std::size_t bufsize, const std::size_t position)
{
if (bufsize < position) {
throw std::invalid_argument("Buffer size should never be less than position!");
}
return std::min(bufsize - position,
static_cast<std::size_t>(std::numeric_limits<int>::max()));
}
template<std::size_t Size>
std::size_t Packing<false,std::bitset<Size>>::
@ -139,6 +148,4 @@ template struct Packing<false,std::bitset<10>>;
constexpr int NumFip = static_cast<int>(FIPConfig::OutputField::NUM_FIP_REPORT);
template struct Packing<false,std::bitset<NumFip>>;
} // end namespace detail
} // end namespace Mpi
} // end namespace Opm
} // end namespace Opm::Mpi::detail

View File

@ -30,17 +30,11 @@
#include <string>
namespace Opm {
namespace Mpi {
namespace Opm::Mpi {
namespace detail {
static std::size_t mpi_buffer_size(const std::size_t bufsize, const std::size_t position) {
if (bufsize < position)
throw std::invalid_argument("Buffer size should never be less than position!");
return static_cast<int>(std::min(bufsize-position,
static_cast<std::size_t>(std::numeric_limits<int>::max())));
}
std::size_t mpi_buffer_size(const std::size_t bufsize, const std::size_t position);
//! \brief Abstract struct for packing which is (partially) specialized for specific types.
template <bool pod, class T>
@ -190,7 +184,8 @@ ADD_PACK_SPECIALIZATION(time_point)
}
//! \brief Struct handling packing of serialization for MPI communication.
struct Packer {
struct Packer
{
//! \brief Constructor.
//! \param comm The communicator to use
Packer(Parallel::Communication comm)
@ -279,7 +274,6 @@ private:
Parallel::Communication m_comm; //!< Communicator to use
};
} // end namespace Mpi
} // end namespace Opm
} // end namespace Opm::Mpi
#endif // MPI_PACKER_HPP