Skip to content
Snippets Groups Projects

Added Bitshift Operator

Merged Noam Zerah requested to merge noamzerah/aidge_backend_cpu:feat_operator_bitshift into dev
All threads resolved!
3 files
+ 35
48
Compare changes
  • Side-by-side
  • Inline
Files
3
@@ -12,7 +12,7 @@
#ifndef AIDGE_CPU_OPERATOR_BITSHIFTIMPL_H_
#define AIDGE_CPU_OPERATOR_BITSHIFTIMPL_H_
#include "aidge/backend/OperatorImpl.hpp"
#include "aidge/backend/cpu/operator/OperatorImpl.hpp"
#include "aidge/operator/BitShift.hpp"
#include "aidge/utils/Registrar.hpp"
#include "aidge/utils/Types.h"
@@ -21,31 +21,18 @@
#include <vector>
namespace Aidge {
// class BitShift_Op;
// compute kernel registry for forward and backward
class BitShiftImplForward_cpu
: public Registrable<BitShiftImplForward_cpu, std::tuple<DataType, DataType, DataType>, void(const BitShift_Op::BitShiftDirection,const std::vector<std::size_t>&, const std::vector<std::size_t>&, const std::vector<std::size_t>&, const void*, const void*,void*)> {
};
class BitShiftImplBackward_cpu
: public Registrable<BitShiftImplBackward_cpu, std::tuple<DataType, DataType, DataType>, void(const BitShift_Op::BitShiftDirection,const std::vector<std::size_t>&, const std::vector<std::size_t>&, const std::vector<std::size_t>&, const void*, const void*, void*)> {
};
class BitShiftImpl_cpu : public OperatorImpl {
public:
BitShiftImpl_cpu(const BitShift_Op& op) : OperatorImpl(op, "cpu") {}
static std::unique_ptr<BitShiftImpl_cpu> create(const BitShift_Op& op) {
return std::make_unique<BitShiftImpl_cpu>(op);
}
Elts_t getNbRequiredProtected(const IOIndex_t inputIdx) const override final;
void forward() override;
};
namespace {
static Registrar<BitShift_Op> registrarBitShiftImpl_cpu("cpu", Aidge::BitShiftImpl_cpu::create);
}
// Operator implementation entry point for the backend
using BitShiftImpl_cpu = OperatorImpl_cpu<BitShift_Op,
void(const BitShift_Op::BitShiftDirection,
const std::vector<std::size_t>&,
const std::vector<std::size_t>&,
const std::vector<std::size_t>&,
const void*,
const void*,
void*)>;
// Implementation entry point registration to Operator
REGISTRAR(BitShift_Op,"cpu",Aidge::BitShiftImpl_cpu::create);
} // namespace Aidge
#endif /* AIDGE_CPU_OPERATOR_BITSHIFTIMPL_H_ */
Loading