From 68ae2715912faa51954aa5590d4f2e0ce3c4f8d2 Mon Sep 17 00:00:00 2001 From: NAUD Maxence <maxence.naud@cea.fr> Date: Wed, 2 Aug 2023 08:05:19 +0000 Subject: [PATCH] [Fix] Remove unused variable warnings and change some variable to const --- include/operator/AddImpl.hpp | 44 +++++++++++++------------- include/operator/AvgPoolingImpl.hpp | 10 +++--- include/operator/BatchNormImpl.hpp | 10 +++--- include/operator/ConvDepthWiseImpl.hpp | 10 +++--- include/operator/ConvImpl.hpp | 10 +++--- include/operator/FCImpl.hpp | 10 +++--- include/operator/LeakyReLUImpl.hpp | 10 +++--- include/operator/ProducerImpl.hpp | 10 +++--- include/operator/ReLUImpl.hpp | 10 +++--- include/operator/SoftmaxImpl.hpp | 10 +++--- src/operator/AddImpl.cpp | 16 +++++----- src/operator/AvgPoolingImpl.cpp | 4 +-- src/operator/BatchNormImpl.cpp | 6 ++-- src/operator/ConvDepthWiseImpl.cpp | 6 ++-- src/operator/ConvImpl.cpp | 6 ++-- src/operator/FCImpl.cpp | 6 ++-- src/operator/LeakyReLUImpl.cpp | 4 +-- src/operator/ProducerImpl.cpp | 2 +- src/operator/ReLUImpl.cpp | 4 +-- src/operator/SoftmaxImpl.cpp | 4 +-- 20 files changed, 96 insertions(+), 96 deletions(-) diff --git a/include/operator/AddImpl.hpp b/include/operator/AddImpl.hpp index a089328c..06175682 100644 --- a/include/operator/AddImpl.hpp +++ b/include/operator/AddImpl.hpp @@ -66,7 +66,7 @@ class AddImpl_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final { + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final { assert(mOp.getInput(inputIdx) && "requires valid input"); // Requires the whole tensors @@ -74,12 +74,12 @@ class AddImpl_cpu : public OperatorImpl { return std::accumulate(inputDims.begin(), inputDims.end(), NbElts_t(1), std::multiplies<NbElts_t>()); } - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final { + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final { // for the direct convolution algorithm, convolutions can be in-place, if there is no padding! return 0; } - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final { + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); @@ -87,12 +87,12 @@ class AddImpl_cpu : public OperatorImpl { return std::accumulate(outputDims.begin(), outputDims.end(), NbElts_t(1), std::multiplies<NbElts_t>()); } - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final { + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final { assert(inputIdx < mNbConsumedData.size()); return mNbConsumedData[inputIdx]; } - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final { + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final { assert(outputIdx < mNbProducedData.size()); return mNbProducedData[outputIdx]; } @@ -119,16 +119,16 @@ class AddImpl_cpu<1> : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t /*inputIdx*/) const override final; + NbElts_t getNbRequiredData(const IOIndex_t /*inputIdx*/) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t /*inputIdx*/) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t /*inputIdx*/) const override final; - NbElts_t getRequiredMemory(IOIndex_t /*outputIdx*/, - const std::vector<DimSize_t>& /*inputsSize*/) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, + __attribute__((unused)) const std::vector<DimSize_t> &inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t /*inputIdx*/) const override final; + NbElts_t getNbConsumedData(const IOIndex_t /*inputIdx*/) const override final; - NbElts_t getNbProducedData(IOIndex_t /*outputIdx*/) const override final; + NbElts_t getNbProducedData(const IOIndex_t /*outputIdx*/) const override final; void forward(); @@ -150,16 +150,16 @@ class AddImpl_cpu<2> : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t /*outputIdx*/, - const std::vector<DimSize_t>& /*inputsSize*/) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, + __attribute__((unused)) const std::vector<DimSize_t>& inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t /*outputIdx*/) const override final; + NbElts_t getNbProducedData(const IOIndex_t /*outputIdx*/) const override final; void forward(); @@ -181,15 +181,15 @@ class AddImpl_cpu<3> : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t /*inputIdx*/) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t /*inputIdx*/) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t>& /*inputsSize*/) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t>& /*inputsSize*/) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/AvgPoolingImpl.hpp b/include/operator/AvgPoolingImpl.hpp index a107bd83..01192f7c 100644 --- a/include/operator/AvgPoolingImpl.hpp +++ b/include/operator/AvgPoolingImpl.hpp @@ -49,11 +49,11 @@ class AvgPoolingImpl2D_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/BatchNormImpl.hpp b/include/operator/BatchNormImpl.hpp index 61dafaf4..57f4aee2 100644 --- a/include/operator/BatchNormImpl.hpp +++ b/include/operator/BatchNormImpl.hpp @@ -64,11 +64,11 @@ class BatchNormImpl2D_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/ConvDepthWiseImpl.hpp b/include/operator/ConvDepthWiseImpl.hpp index 4557b37a..b1a2004d 100644 --- a/include/operator/ConvDepthWiseImpl.hpp +++ b/include/operator/ConvDepthWiseImpl.hpp @@ -51,11 +51,11 @@ class ConvDepthWiseImpl2D_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/ConvImpl.hpp b/include/operator/ConvImpl.hpp index 9db557b7..81768f68 100644 --- a/include/operator/ConvImpl.hpp +++ b/include/operator/ConvImpl.hpp @@ -51,11 +51,11 @@ class ConvImpl2D_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/FCImpl.hpp b/include/operator/FCImpl.hpp index f06861ef..d331b79e 100644 --- a/include/operator/FCImpl.hpp +++ b/include/operator/FCImpl.hpp @@ -45,11 +45,11 @@ class FCImpl_cpu : public OperatorImpl { static std::unique_ptr<FCImpl_cpu> create(const FC_Op &op) { return std::make_unique<FCImpl_cpu>(op); } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/LeakyReLUImpl.hpp b/include/operator/LeakyReLUImpl.hpp index 7b71f4e7..115926e9 100644 --- a/include/operator/LeakyReLUImpl.hpp +++ b/include/operator/LeakyReLUImpl.hpp @@ -44,11 +44,11 @@ class LeakyReLUImpl_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/ProducerImpl.hpp b/include/operator/ProducerImpl.hpp index 23be4b6d..6f424c8f 100644 --- a/include/operator/ProducerImpl.hpp +++ b/include/operator/ProducerImpl.hpp @@ -32,11 +32,11 @@ class ProducerImpl_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/ReLUImpl.hpp b/include/operator/ReLUImpl.hpp index 714a44a2..5797b9a9 100644 --- a/include/operator/ReLUImpl.hpp +++ b/include/operator/ReLUImpl.hpp @@ -44,11 +44,11 @@ class ReLUImpl_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/include/operator/SoftmaxImpl.hpp b/include/operator/SoftmaxImpl.hpp index eb4062b6..c6f881e7 100644 --- a/include/operator/SoftmaxImpl.hpp +++ b/include/operator/SoftmaxImpl.hpp @@ -44,11 +44,11 @@ class SoftmaxImpl_cpu : public OperatorImpl { } public: - NbElts_t getNbRequiredData(IOIndex_t inputIdx) const override final; - NbElts_t getNbRequiredProtected(IOIndex_t inputIdx) const override final; - NbElts_t getRequiredMemory(IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final; - NbElts_t getNbConsumedData(IOIndex_t inputIdx) const override final; - NbElts_t getNbProducedData(IOIndex_t outputIdx) const override final; + NbElts_t getNbRequiredData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; + NbElts_t getRequiredMemory(__attribute__((unused)) const IOIndex_t outputIdx, const std::vector<DimSize_t>& inputsSize) const override final; + NbElts_t getNbConsumedData(const IOIndex_t inputIdx) const override final; + NbElts_t getNbProducedData(const IOIndex_t outputIdx) const override final; void forward(); diff --git a/src/operator/AddImpl.cpp b/src/operator/AddImpl.cpp index 5b84bc8e..1dd998e9 100644 --- a/src/operator/AddImpl.cpp +++ b/src/operator/AddImpl.cpp @@ -31,12 +31,12 @@ Aidge::NbElts_t Aidge::AddImpl_cpu<1>::getNbRequiredData(Aidge::IOIndex_t /*inpu return static_cast<int>(std::static_pointer_cast<Tensor>(mOp.getInput(0))->size()); } -Aidge::NbElts_t Aidge::AddImpl_cpu<1>::getNbRequiredProtected(Aidge::IOIndex_t /*inputIdx*/) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<1>::getNbRequiredProtected(const Aidge::IOIndex_t /*inputIdx*/) const { // for the direct convolution algorithm, convolutions can be in-place, if there is no padding! return 0; } -Aidge::NbElts_t Aidge::AddImpl_cpu<1>::getRequiredMemory(Aidge::IOIndex_t /*outputIdx*/, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<1>::getRequiredMemory(const Aidge::IOIndex_t /*outputIdx*/, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { // Requires the whole tensors, regardless of available data on inputs return std::static_pointer_cast<Tensor>(mOp.getOutput(0))->size(); } @@ -80,7 +80,7 @@ void Aidge::AddImpl_cpu<1>::backward() { ////////////////////////////////// -Aidge::NbElts_t Aidge::AddImpl_cpu<2>::getNbRequiredData(Aidge::IOIndex_t inputIdx) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<2>::getNbRequiredData(const Aidge::IOIndex_t inputIdx) const { assert(mOp.getInput(inputIdx) && "requires valid input"); // Requires the whole tensors @@ -90,12 +90,12 @@ Aidge::NbElts_t Aidge::AddImpl_cpu<2>::getNbRequiredData(Aidge::IOIndex_t inputI NbElts_t(1), std::multiplies<NbElts_t>()); } -Aidge::NbElts_t Aidge::AddImpl_cpu<2>::getNbRequiredProtected(Aidge::IOIndex_t /*inputIdx*/) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<2>::getNbRequiredProtected(const Aidge::IOIndex_t /*inputIdx*/) const { // for the direct convolution algorithm, convolutions can be in-place, if there is no padding! return 0; } -Aidge::NbElts_t Aidge::AddImpl_cpu<2>::getRequiredMemory(Aidge::IOIndex_t outputIdx, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<2>::getRequiredMemory(const Aidge::IOIndex_t outputIdx, __attribute__((unused)) const std::vector<Aidge::DimSize_t>& inputsSize) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); @@ -147,7 +147,7 @@ void Aidge::AddImpl_cpu<2>::backward() { ////////////////////////////////// -Aidge::NbElts_t Aidge::AddImpl_cpu<3>::getNbRequiredData(Aidge::IOIndex_t inputIdx) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<3>::getNbRequiredData(const Aidge::IOIndex_t inputIdx) const { assert(mOp.getInput(inputIdx) && "requires valid input"); // Requires the whole tensors @@ -157,12 +157,12 @@ Aidge::NbElts_t Aidge::AddImpl_cpu<3>::getNbRequiredData(Aidge::IOIndex_t inputI Aidge::NbElts_t(1), std::multiplies<Aidge::NbElts_t>()); } -Aidge::NbElts_t Aidge::AddImpl_cpu<3>::getNbRequiredProtected(Aidge::IOIndex_t /*inputIdx*/) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<3>::getNbRequiredProtected(const Aidge::IOIndex_t /*inputIdx*/) const { // for the direct convolution algorithm, convolutions can be in-place, if there is no padding! return 0; } -Aidge::NbElts_t Aidge::AddImpl_cpu<3>::getRequiredMemory(Aidge::IOIndex_t outputIdx, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { +Aidge::NbElts_t Aidge::AddImpl_cpu<3>::getRequiredMemory(const Aidge::IOIndex_t outputIdx, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); diff --git a/src/operator/AvgPoolingImpl.cpp b/src/operator/AvgPoolingImpl.cpp index dfa6357e..fafefc4b 100644 --- a/src/operator/AvgPoolingImpl.cpp +++ b/src/operator/AvgPoolingImpl.cpp @@ -20,7 +20,7 @@ #include "operator/AvgPooling.hpp" #include "utils/Types.h" -Aidge::NbElts_t Aidge::AvgPoolingImpl2D_cpu::getNbRequiredData(Aidge::IOIndex_t inputIdx) const { +Aidge::NbElts_t Aidge::AvgPoolingImpl2D_cpu::getNbRequiredData(const Aidge::IOIndex_t inputIdx) const { assert(mOp.getInput(inputIdx) && "requires valid input"); // Requires the whole tensors @@ -35,7 +35,7 @@ Aidge::NbElts_t Aidge::AvgPoolingImpl2D_cpu::getNbRequiredProtected(IOIndex_t /* return 0; } -Aidge::NbElts_t Aidge::AvgPoolingImpl2D_cpu::getRequiredMemory(Aidge::IOIndex_t outputIdx, +Aidge::NbElts_t Aidge::AvgPoolingImpl2D_cpu::getRequiredMemory(const Aidge::IOIndex_t outputIdx, const std::vector<Aidge::DimSize_t> & /*inputsSize*/) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); diff --git a/src/operator/BatchNormImpl.cpp b/src/operator/BatchNormImpl.cpp index d94f4389..bdbb04fd 100644 --- a/src/operator/BatchNormImpl.cpp +++ b/src/operator/BatchNormImpl.cpp @@ -20,7 +20,7 @@ #include "operator/BatchNorm.hpp" #include "utils/Types.h" -Aidge::NbElts_t Aidge::BatchNormImpl2D_cpu::getNbRequiredData(Aidge::IOIndex_t inputIdx) const { +Aidge::NbElts_t Aidge::BatchNormImpl2D_cpu::getNbRequiredData(const Aidge::IOIndex_t inputIdx) const { assert(mOp.getInput(inputIdx) && "requires valid input"); // Requires the whole tensors @@ -35,8 +35,8 @@ Aidge::NbElts_t Aidge::BatchNormImpl2D_cpu::getNbRequiredProtected(IOIndex_t /*i return 0; } -Aidge::NbElts_t Aidge::BatchNormImpl2D_cpu::getRequiredMemory(Aidge::IOIndex_t outputIdx, - const std::vector<Aidge::DimSize_t> & /*inputsSize*/) const { +Aidge::NbElts_t Aidge::BatchNormImpl2D_cpu::getRequiredMemory(const Aidge::IOIndex_t outputIdx, + const std::vector<Aidge::DimSize_t> &inputsSize) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); diff --git a/src/operator/ConvDepthWiseImpl.cpp b/src/operator/ConvDepthWiseImpl.cpp index ff5bf1e9..667a45c2 100644 --- a/src/operator/ConvDepthWiseImpl.cpp +++ b/src/operator/ConvDepthWiseImpl.cpp @@ -21,7 +21,7 @@ #include "operator/ConvDepthWise.hpp" #include "utils/Types.h" -Aidge::NbElts_t Aidge::ConvDepthWiseImpl2D_cpu::getNbRequiredData(Aidge::IOIndex_t inputIdx) const { +Aidge::NbElts_t Aidge::ConvDepthWiseImpl2D_cpu::getNbRequiredData(const Aidge::IOIndex_t inputIdx) const { assert(mOp.getInput(inputIdx) && "requires valid input"); // Requires the whole tensors @@ -36,8 +36,8 @@ Aidge::NbElts_t Aidge::ConvDepthWiseImpl2D_cpu::getNbRequiredProtected(IOIndex_t return 0; } -Aidge::NbElts_t Aidge::ConvDepthWiseImpl2D_cpu::getRequiredMemory(Aidge::IOIndex_t outputIdx, - const std::vector<Aidge::DimSize_t> & /*inputsSize*/) const { +Aidge::NbElts_t Aidge::ConvDepthWiseImpl2D_cpu::getRequiredMemory(const Aidge::IOIndex_t outputIdx, + const std::vector<Aidge::DimSize_t> &inputsSize) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); diff --git a/src/operator/ConvImpl.cpp b/src/operator/ConvImpl.cpp index 213f0a36..21f8db4a 100644 --- a/src/operator/ConvImpl.cpp +++ b/src/operator/ConvImpl.cpp @@ -21,7 +21,7 @@ #include "operator/Conv.hpp" #include "utils/Types.h" -Aidge::NbElts_t Aidge::ConvImpl2D_cpu::getNbRequiredData(Aidge::IOIndex_t inputIdx) const { +Aidge::NbElts_t Aidge::ConvImpl2D_cpu::getNbRequiredData(const Aidge::IOIndex_t inputIdx) const { assert(mOp.getInput(inputIdx) && "requires valid input"); // Requires the whole tensors @@ -36,8 +36,8 @@ Aidge::NbElts_t Aidge::ConvImpl2D_cpu::getNbRequiredProtected(IOIndex_t /*inputI return 0; } -Aidge::NbElts_t Aidge::ConvImpl2D_cpu::getRequiredMemory(Aidge::IOIndex_t outputIdx, - const std::vector<Aidge::DimSize_t> & /*inputsSize*/) const { +Aidge::NbElts_t Aidge::ConvImpl2D_cpu::getRequiredMemory(const Aidge::IOIndex_t outputIdx, + const std::vector<Aidge::DimSize_t> &inputsSize) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); diff --git a/src/operator/FCImpl.cpp b/src/operator/FCImpl.cpp index 58a7f3ce..86ee79c6 100644 --- a/src/operator/FCImpl.cpp +++ b/src/operator/FCImpl.cpp @@ -20,7 +20,7 @@ #include "operator/FCImpl_forward_kernels.hpp" #include "utils/Types.h" -Aidge::NbElts_t Aidge::FCImpl_cpu::getNbRequiredData(Aidge::IOIndex_t inputIdx) const +Aidge::NbElts_t Aidge::FCImpl_cpu::getNbRequiredData(const Aidge::IOIndex_t inputIdx) const { assert(mOp.getInput(inputIdx) && "requires valid input"); @@ -36,7 +36,7 @@ Aidge::NbElts_t Aidge::FCImpl_cpu::getNbRequiredData(Aidge::IOIndex_t inputIdx) } Aidge::NbElts_t - Aidge::FCImpl_cpu::getNbRequiredProtected(Aidge::IOIndex_t /*inputIdx*/) const + Aidge::FCImpl_cpu::getNbRequiredProtected(const Aidge::IOIndex_t /*inputIdx*/) const { // for the direct convolution algorithm, convolutions can be in-place, if // there is no padding! @@ -44,7 +44,7 @@ Aidge::NbElts_t } Aidge::NbElts_t Aidge::FCImpl_cpu::getRequiredMemory( - IOIndex_t outputIdx, const std::vector<DimSize_t> & /*inputsSize*/) const + const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); diff --git a/src/operator/LeakyReLUImpl.cpp b/src/operator/LeakyReLUImpl.cpp index f1338835..c05af23a 100644 --- a/src/operator/LeakyReLUImpl.cpp +++ b/src/operator/LeakyReLUImpl.cpp @@ -33,12 +33,12 @@ Aidge::NbElts_t Aidge::LeakyReLUImpl_cpu::getNbRequiredData(Aidge::IOIndex_t /*i static_cast<NbElts_t>(1), std::multiplies<NbElts_t>()); } -Aidge::NbElts_t Aidge::LeakyReLUImpl_cpu::getNbRequiredProtected(Aidge::IOIndex_t /*inputIdx*/) const { +Aidge::NbElts_t Aidge::LeakyReLUImpl_cpu::getNbRequiredProtected(const Aidge::IOIndex_t /*inputIdx*/) const { // for the direct convolution algorithm, convolutions can be in-place, if there is no padding! return 0; } -Aidge::NbElts_t Aidge::LeakyReLUImpl_cpu::getRequiredMemory(Aidge::IOIndex_t /*outputIdx*/, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { +Aidge::NbElts_t Aidge::LeakyReLUImpl_cpu::getRequiredMemory(const Aidge::IOIndex_t outputIdx, const std::vector<Aidge::DimSize_t> &inputsSize) const { const auto& outputDims = mOp.getOutput(0)->dims(); return std::accumulate(outputDims.begin(), outputDims.end(), static_cast<NbElts_t>(1), std::multiplies<NbElts_t>()); diff --git a/src/operator/ProducerImpl.cpp b/src/operator/ProducerImpl.cpp index cbdd0554..6f067dbe 100644 --- a/src/operator/ProducerImpl.cpp +++ b/src/operator/ProducerImpl.cpp @@ -42,7 +42,7 @@ std::size_t Aidge::ProducerImpl_cpu::getNbRequiredProtected( std::size_t Aidge::ProducerImpl_cpu::getRequiredMemory( - IOIndex_t outputIdx, const std::vector<DimSize_t> & /*inputsSize*/) const + const IOIndex_t outputIdx, const std::vector<DimSize_t> &inputsSize) const { // Requires the whole tensors, regardless of available data on inputs assert(outputIdx == 0 && "operator has only one output"); diff --git a/src/operator/ReLUImpl.cpp b/src/operator/ReLUImpl.cpp index 4d8472c0..1512cef9 100644 --- a/src/operator/ReLUImpl.cpp +++ b/src/operator/ReLUImpl.cpp @@ -33,12 +33,12 @@ Aidge::NbElts_t Aidge::ReLUImpl_cpu::getNbRequiredData(Aidge::IOIndex_t /*inputI static_cast<NbElts_t>(1), std::multiplies<NbElts_t>()); } -Aidge::NbElts_t Aidge::ReLUImpl_cpu::getNbRequiredProtected(Aidge::IOIndex_t /*inputIdx*/) const { +Aidge::NbElts_t Aidge::ReLUImpl_cpu::getNbRequiredProtected(const Aidge::IOIndex_t /*inputIdx*/) const { // for the direct convolution algorithm, convolutions can be in-place, if there is no padding! return 0; } -Aidge::NbElts_t Aidge::ReLUImpl_cpu::getRequiredMemory(Aidge::IOIndex_t /*outputIdx*/, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { +Aidge::NbElts_t Aidge::ReLUImpl_cpu::getRequiredMemory(const Aidge::IOIndex_t outputIdx, const std::vector<Aidge::DimSize_t> &inputsSize) const { const auto& outputDims = std::static_pointer_cast<Tensor>(mOp.getOutput(0))->dims(); return std::accumulate(outputDims.begin(), outputDims.end(), static_cast<NbElts_t>(1), std::multiplies<NbElts_t>()); diff --git a/src/operator/SoftmaxImpl.cpp b/src/operator/SoftmaxImpl.cpp index f5f0bb73..79b86824 100644 --- a/src/operator/SoftmaxImpl.cpp +++ b/src/operator/SoftmaxImpl.cpp @@ -33,12 +33,12 @@ Aidge::NbElts_t Aidge::SoftmaxImpl_cpu::getNbRequiredData(Aidge::IOIndex_t /*inp static_cast<NbElts_t>(1), std::multiplies<NbElts_t>()); } -Aidge::NbElts_t Aidge::SoftmaxImpl_cpu::getNbRequiredProtected(Aidge::IOIndex_t /*inputIdx*/) const { +Aidge::NbElts_t Aidge::SoftmaxImpl_cpu::getNbRequiredProtected(const Aidge::IOIndex_t /*inputIdx*/) const { // for the direct convolution algorithm, convolutions can be in-place, if there is no padding! return 0; } -Aidge::NbElts_t Aidge::SoftmaxImpl_cpu::getRequiredMemory(Aidge::IOIndex_t /*outputIdx*/, const std::vector<Aidge::DimSize_t>& /*inputsSize*/) const { +Aidge::NbElts_t Aidge::SoftmaxImpl_cpu::getRequiredMemory(const Aidge::IOIndex_t outputIdx, const std::vector<Aidge::DimSize_t> &inputsSize) const { const auto& outputDims = std::static_pointer_cast<Tensor>(mOp.getOutput(0))->dims(); return std::accumulate(outputDims.begin(), outputDims.end(), static_cast<NbElts_t>(1), std::multiplies<NbElts_t>()); -- GitLab