/******************************************************************************** * Copyright (c) 2023 CEA-List * * This program and the accompanying materials are made available under the * terms of the Eclipse Public License 2.0 which is available at * http://www.eclipse.org/legal/epl-2.0. * * SPDX-License-Identifier: EPL-2.0 * ********************************************************************************/ #ifndef AIDGE_CPU_OPERATOR_LEAKYRELUIMPL_H_ #define AIDGE_CPU_OPERATOR_LEAKYRELUIMPL_H_ #include "aidge/backend/OperatorImpl.hpp" #include "aidge/operator/LeakyReLU.hpp" #include "aidge/utils/Registrar.hpp" #include "aidge/utils/Types.h" #include <memory> #include <vector> namespace Aidge { // class LeakyReLU_Op; // compute kernel registry for forward and backward class LeakyReLUImplForward_cpu : public Registrable<LeakyReLUImplForward_cpu, std::tuple<DataType, DataType>, void(const LeakyReLU_Op::Attrs&, std::size_t, const void*, void*)> { }; class LeakyReLUImplBackward_cpu : public Registrable<LeakyReLUImplBackward_cpu, std::tuple<DataType, DataType>, void(const LeakyReLU_Op::Attrs&, std::size_t, const void*, void*)> { }; class LeakyReLUImpl_cpu : public OperatorImpl { public: LeakyReLUImpl_cpu(const LeakyReLU_Op& op) : OperatorImpl(op) {} static std::unique_ptr<LeakyReLUImpl_cpu> create(const LeakyReLU_Op& op) { return std::make_unique<LeakyReLUImpl_cpu>(op); } NbElts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final; void forward() override; }; namespace { static Registrar<LeakyReLU_Op> registrarLeakyReLUImpl_cpu("cpu", Aidge::LeakyReLUImpl_cpu::create); } } // namespace Aidge #endif /* AIDGE_CPU_OPERATOR_LEAKYRELUIMPL_H_ */