Introduce `IBackendConfig::getOperandLayout` which returns
`operand::Layout` for each backend. Note that this assumes a backend
only support one type of operand layout.
Signed-off-by: Hanjoung Lee <hanjoung.lee@samsung.com>
#ifndef __INTERNAL_IBACKEND_CONFIG_H__
#define __INTERNAL_IBACKEND_CONFIG_H__
+#include "graph/operand/Layout.h"
+
namespace neurun
{
namespace backend
virtual ~IBackendConfig() = default;
virtual void initialize() = 0;
+ // NOTE Assume backend has only one type of operand layout
+ virtual graph::operand::Layout getOperandLayout() = 0;
};
} // namespace backend
}
virtual void initialize() override;
+ virtual graph::operand::Layout getOperandLayout() { return graph::operand::Layout::NCHW; }
};
} // namespace acl_cl
}
virtual void initialize() override;
+ virtual graph::operand::Layout getOperandLayout() { return graph::operand::Layout::NHWC; }
};
} // namespace cpu
--- /dev/null
+#ifndef __NEURUN_GRAPH_OPERAND_LAYOUT_H__
+#define __NEURUN_GRAPH_OPERAND_LAYOUT_H__
+
+namespace neurun
+{
+namespace graph
+{
+namespace operand
+{
+
+enum class Layout
+{
+ UNKNOWN = 0,
+ NHWC,
+ NCHW
+};
+
+} // namespace operand
+} // namespace graph
+} // namespace neurun
+
+#endif // __NEURUN_GRAPH_OPERAND_LAYOUT_H__