From 97c657cc76e7da4b2a3ca747f30c3e6ce873e080 Mon Sep 17 00:00:00 2001 From: Olivier BICHLER <olivier.bichler@cea.fr> Date: Tue, 29 Aug 2023 17:07:13 +0200 Subject: [PATCH] Removed __attribute__((unused)) --- include/aidge/operator/Add.hpp | 6 +++--- include/aidge/operator/AvgPooling.hpp | 14 +++++++------- include/aidge/operator/BatchNorm.hpp | 8 ++++---- include/aidge/operator/Conv.hpp | 8 ++++---- include/aidge/operator/ConvDepthWise.hpp | 8 ++++---- include/aidge/operator/FC.hpp | 8 ++++---- include/aidge/operator/GenericOperator.hpp | 2 +- include/aidge/operator/LeakyReLU.hpp | 14 +++++++------- include/aidge/operator/Matmul.hpp | 8 ++++---- include/aidge/operator/Producer.hpp | 14 +++++++------- include/aidge/operator/ReLU.hpp | 14 +++++++------- include/aidge/operator/Softmax.hpp | 14 +++++++------- src/graph/GraphView.cpp | 6 ++++-- src/graph/Node.cpp | 3 ++- 14 files changed, 65 insertions(+), 62 deletions(-) diff --git a/include/aidge/operator/Add.hpp b/include/aidge/operator/Add.hpp index de9afab20..2575e165b 100644 --- a/include/aidge/operator/Add.hpp +++ b/include/aidge/operator/Add.hpp @@ -93,13 +93,13 @@ public: assert(static_cast<std::size_t>(inputIdx) < NUM && "wrong inputIdx for Add operator."); return *(mInputs[inputIdx].get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert(static_cast<std::size_t>(inputIdx) < NUM && "wrong inputIdx for Add operator."); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "Add Operators has only 1 outputs"); return mOutput; } @@ -108,7 +108,7 @@ public: assert(static_cast<std::size_t>(inputIdx) < NUM && "wrong inputIdx for Add operator."); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/AvgPooling.hpp b/include/aidge/operator/AvgPooling.hpp index 0dbd91e05..a43184437 100644 --- a/include/aidge/operator/AvgPooling.hpp +++ b/include/aidge/operator/AvgPooling.hpp @@ -63,7 +63,7 @@ public: setDatatype(DataType::Float32); } - constexpr void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + constexpr void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx < 1 && "operators supports only 3 inputs"); assert(strcmp(data->type(), Tensor::Type) == 0 && "input data must be of Tensor type"); @@ -91,28 +91,28 @@ public: bool outputDimsForwarded() const override final { return !(mOutput->empty()); } - inline Tensor& input(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + inline Tensor& input(const IOIndex_t /*inputIdx*/) const override final { assert(inputIdx == 0 && "operators supports only 1 inputs"); return *(mInput.get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { assert(inputIdx == 0 && "AvgPooling Operators supports only 1 inputs"); return mInput; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "AvgPooling Operators has only 1 outputs"); return mOutput; } - std::shared_ptr<Data> getRawInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { assert(inputIdx == 0 && "operators supports only 1 inputs"); return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/BatchNorm.hpp b/include/aidge/operator/BatchNorm.hpp index 01a6ccf4f..cecf006b0 100644 --- a/include/aidge/operator/BatchNorm.hpp +++ b/include/aidge/operator/BatchNorm.hpp @@ -65,7 +65,7 @@ public: // return *in; // } - constexpr void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + constexpr void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx < 5 && "operators supports only 5 inputs"); assert(strcmp(data->type(), Tensor::Type) == 0 && "input data must be of Tensor type"); @@ -90,14 +90,14 @@ public: assert(inputIdx < 5 && "operators supports only 5 inputs"); return *(mInputs[inputIdx].get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert(inputIdx < 5 && "BatchNorm Operators supports only 5 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "BatchNorm Operator has only 1 output"); return mOutput; } @@ -107,7 +107,7 @@ public: assert(inputIdx < 5 && "operators supports only 5 inputs"); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/Conv.hpp b/include/aidge/operator/Conv.hpp index 1fcea7a4b..df0876941 100644 --- a/include/aidge/operator/Conv.hpp +++ b/include/aidge/operator/Conv.hpp @@ -79,7 +79,7 @@ public: // } - constexpr void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + constexpr void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx < 3 && "operators supports only 3 inputs"); assert(strcmp(data->type(), Tensor::Type) == 0 && "input data must be of Tensor type"); @@ -114,14 +114,14 @@ public: inline Tensor& input(const IOIndex_t inputIdx) const override final { assert(inputIdx < 3 && "operators supports only 3 inputs"); return *(mInputs[inputIdx].get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert(inputIdx < 3 && "Conv Operators supports only 3 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "Conv Operator has only 1 output"); return mOutput; } @@ -131,7 +131,7 @@ public: assert(inputIdx < 3 && "operators supports only 3 inputs"); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/ConvDepthWise.hpp b/include/aidge/operator/ConvDepthWise.hpp index 4a4af179b..e3102d385 100644 --- a/include/aidge/operator/ConvDepthWise.hpp +++ b/include/aidge/operator/ConvDepthWise.hpp @@ -71,7 +71,7 @@ class ConvDepthWise_Op : public Operator, setDatatype(DataType::Float32); } - constexpr void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + constexpr void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx < 3 && "operators supports only 3 inputs"); assert(strcmp(data->type(), Tensor::Type) == 0 && "input data must be of Tensor type"); @@ -114,14 +114,14 @@ class ConvDepthWise_Op : public Operator, assert(inputIdx < 3 && "operators supports only 3 inputs"); return *(mInputs[inputIdx].get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert(inputIdx < 3 && "ConvDepthWise Operators supports only 3 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "ConvDepthWise Operator has only 1 output"); return mOutput; } @@ -131,7 +131,7 @@ class ConvDepthWise_Op : public Operator, assert(inputIdx < 3 && "operators supports only 3 inputs"); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/FC.hpp b/include/aidge/operator/FC.hpp index 743620443..6a68a6e18 100644 --- a/include/aidge/operator/FC.hpp +++ b/include/aidge/operator/FC.hpp @@ -57,7 +57,7 @@ public: setDatatype(DataType::Float32); } - void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx < 3 && "operators supports only 3 inputs"); assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); if (inputIdx == 2) { @@ -89,14 +89,14 @@ public: inline Tensor& input(const IOIndex_t inputIdx) const override final { assert(inputIdx < 3 && "operators supports only 3 inputs"); return *(mInputs[inputIdx].get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t inputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*inputIdx*/) const override final { return *(mOutput.get()); } inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert(inputIdx < 3 && "FC Operators supports only 3 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "FC Operator has only 1 output"); return mOutput; } @@ -106,7 +106,7 @@ public: assert(inputIdx < 3 && "operators supports only 3 inputs"); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/GenericOperator.hpp b/include/aidge/operator/GenericOperator.hpp index 7efbe62a4..a3e1f0291 100644 --- a/include/aidge/operator/GenericOperator.hpp +++ b/include/aidge/operator/GenericOperator.hpp @@ -85,7 +85,7 @@ class GenericOperator_Op std::vector<std::string> getParametersName() { return mParams.getParametersName(); } // Override Virtual Opertor methods - void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, __attribute__((unused)) std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> /*data*/) override final { printf("Info: using associateInput() on a GenericOperator.\n"); } diff --git a/include/aidge/operator/LeakyReLU.hpp b/include/aidge/operator/LeakyReLU.hpp index 058f41fd8..4270ab487 100644 --- a/include/aidge/operator/LeakyReLU.hpp +++ b/include/aidge/operator/LeakyReLU.hpp @@ -53,7 +53,7 @@ public: setDatatype(DataType::Float32); } - void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx == 0 && "operator supports only 1 input"); assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInput = std::dynamic_pointer_cast<Tensor>(data); @@ -69,25 +69,25 @@ public: } - inline Tensor& input(__attribute__((unused)) const IOIndex_t inputIdx) const override final { return *(mInput.get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& input(const IOIndex_t /*inputIdx*/) const override final { return *(mInput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { assert((inputIdx == 0) && "LeakyReLU Operator has only 1 input"); return mInput; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "LeakyReLU Operator has only 1 output"); return mOutput; } - std::shared_ptr<Data> getRawInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { assert(inputIdx == 0 && "operator supports only 1 input"); return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return mOutput; } diff --git a/include/aidge/operator/Matmul.hpp b/include/aidge/operator/Matmul.hpp index b6181989c..58ea91b91 100644 --- a/include/aidge/operator/Matmul.hpp +++ b/include/aidge/operator/Matmul.hpp @@ -55,7 +55,7 @@ public: setDatatype(DataType::Float32); } - void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx < 2 && "operators supports only 2 inputs"); assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInputs[inputIdx] = std::dynamic_pointer_cast<Tensor>(data); @@ -81,14 +81,14 @@ public: inline Tensor& input(const IOIndex_t inputIdx) const override final { assert(inputIdx < 2 && "operators supports only 2 inputs"); return *(mInputs[inputIdx].get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } inline std::shared_ptr<Tensor> getInput(const IOIndex_t inputIdx) const override final { assert(inputIdx < 2 && "MatMul Operators has 2 inputs"); return mInputs[inputIdx]; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "MatMul Operators has 1 output"); return mOutput; } @@ -98,7 +98,7 @@ public: assert(inputIdx < 2 && "operators supports only 2 inputs"); return std::static_pointer_cast<Data>(mInputs[inputIdx]); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/Producer.hpp b/include/aidge/operator/Producer.hpp index 4268b46b2..cbd587037 100644 --- a/include/aidge/operator/Producer.hpp +++ b/include/aidge/operator/Producer.hpp @@ -51,7 +51,7 @@ public: setDatatype(tensor->dataType()); } - void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, __attribute__((unused)) std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> /*data*/) override final { assert(false && "Producer operator takes no input"); } @@ -60,29 +60,29 @@ public: constexpr bool outputDimsForwarded() const override final {return true;} - [[noreturn]] inline Tensor& input(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + [[noreturn]] inline Tensor& input(const IOIndex_t /*inputIdx*/) const override final { assert(false); exit(-1); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { assert(false && "Producer Operator has no input"); return nullptr; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "Producer Operator has only 1 output"); return mOutput; } - std::shared_ptr<Data> getRawInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { assert(false && "Producer operator takes no input"); return nullptr; } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/ReLU.hpp b/include/aidge/operator/ReLU.hpp index b969a76bc..972a73388 100644 --- a/include/aidge/operator/ReLU.hpp +++ b/include/aidge/operator/ReLU.hpp @@ -42,7 +42,7 @@ public: setDatatype(DataType::Float32); } - void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx == 0 && "operator supports only 1 input"); assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInput = std::dynamic_pointer_cast<Tensor>(data); @@ -58,25 +58,25 @@ public: } - inline Tensor& input(__attribute__((unused)) const IOIndex_t inputIdx) const override final { return *(mInput.get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& input(const IOIndex_t /*inputIdx*/) const override final { return *(mInput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { assert((inputIdx == 0) && "ReLU Operator has only 1 input"); return mInput; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "ReLU Operator has only 1 output"); return mOutput; } - std::shared_ptr<Data> getRawInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { assert(inputIdx == 0 && "operator supports only 1 input"); return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/include/aidge/operator/Softmax.hpp b/include/aidge/operator/Softmax.hpp index 3d3cb8204..81eb7fa90 100644 --- a/include/aidge/operator/Softmax.hpp +++ b/include/aidge/operator/Softmax.hpp @@ -42,7 +42,7 @@ public: setDatatype(DataType::Float32); } - void associateInput(__attribute__((unused)) const IOIndex_t inputIdx, std::shared_ptr<Data> data) override final { + void associateInput(const IOIndex_t /*inputIdx*/, std::shared_ptr<Data> data) override final { assert(inputIdx == 0 && "operator supports only 1 input"); assert(strcmp(data->type(), Tensor::Type)==0 && "input data must be of Tensor type"); mInput = std::dynamic_pointer_cast<Tensor>(data); @@ -58,25 +58,25 @@ public: } - inline Tensor& input(__attribute__((unused)) const IOIndex_t inputIdx) const override final { return *(mInput.get()); } - inline Tensor& output(__attribute__((unused)) const IOIndex_t outputIdx) const override final { return *(mOutput.get()); } + inline Tensor& input(const IOIndex_t /*inputIdx*/) const override final { return *(mInput.get()); } + inline Tensor& output(const IOIndex_t /*outputIdx*/) const override final { return *(mOutput.get()); } - inline std::shared_ptr<Tensor> getInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + inline std::shared_ptr<Tensor> getInput(const IOIndex_t /*inputIdx*/) const override final { assert((inputIdx == 0) && "Softmax Operator has only 1 input"); return mInput; } - inline std::shared_ptr<Tensor> getOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + inline std::shared_ptr<Tensor> getOutput(const IOIndex_t /*outputIdx*/) const override final { assert((outputIdx == 0) && "Softmax Operator has only 1 output"); return mOutput; } - std::shared_ptr<Data> getRawInput(__attribute__((unused)) const IOIndex_t inputIdx) const override final { + std::shared_ptr<Data> getRawInput(const IOIndex_t /*inputIdx*/) const override final { assert(inputIdx == 0 && "operator supports only 1 input"); return std::static_pointer_cast<Data>(mInput); } - std::shared_ptr<Data> getRawOutput(__attribute__((unused)) const IOIndex_t outputIdx) const override final { + std::shared_ptr<Data> getRawOutput(const IOIndex_t /*outputIdx*/) const override final { assert(outputIdx == 0 && "operator supports only 1 output"); return std::static_pointer_cast<Data>(mOutput); } diff --git a/src/graph/GraphView.cpp b/src/graph/GraphView.cpp index 53d9f844a..e8b29c67c 100644 --- a/src/graph/GraphView.cpp +++ b/src/graph/GraphView.cpp @@ -28,13 +28,15 @@ Aidge::Connector Aidge::GraphView::operator()( assert((inputNodes().size() == 1U) && "Too many input Nodes for the GraphView, undefined behaviour"); std::shared_ptr<Node> inNode = *inputNodes().begin(); assert((ctors.size() == static_cast<std::size_t>(inNode->nbDataInputs())) && "Wrong number of arguments.\n"); - for (__attribute__((unused)) std::pair<std::shared_ptr<Node>, IOIndex_t> &input : inNode->inputs()) { + for (std::pair<std::shared_ptr<Node>, IOIndex_t> &input : inNode->inputs()) { assert((gk_IODefaultIndex == input.second) && "At least one input connection is not free.\n"); + (void)input; // Suppress ununsed warning } - for (__attribute__((unused)) const Connector &ctor : ctors) { + for (const Connector &ctor : ctors) { assert((ctor.node() != nullptr) && "Input Connector must be associated with a node"); + (void)ctors; // Suppress ununsed warning } IOIndex_t inID = 0; for (const Connector &ctor : ctors) { diff --git a/src/graph/Node.cpp b/src/graph/Node.cpp index 286ed7136..f4e2b5818 100644 --- a/src/graph/Node.cpp +++ b/src/graph/Node.cpp @@ -35,8 +35,9 @@ Aidge::Node::Node(std::shared_ptr<Operator> op, const char *name) Aidge::Connector Aidge::Node::operator()(const std::vector<Connector> &ctors) { assert((ctors.size() == nbDataInputs()) && "Wrong number of arguments.\n"); - for (__attribute__((unused)) std::pair<std::shared_ptr<Node>, IOIndex_t> &input : inputs()) { + for (std::pair<std::shared_ptr<Node>, IOIndex_t> &input : inputs()) { assert((gk_IODefaultIndex == input.second) && "At least one input connection is not free.\n"); + (void) input; } IOIndex_t i = 0; for (const Connector &ctor : ctors) { -- GitLab