#ifndef __NNOP_CONV2D_H__
#define __NNOP_CONV2D_H__
+#include "nnop/PadInfo.h"
+#include "nnop/StrideInfo.h"
+
#include <nncc/core/ADT/feature/Shape.h>
#include <nncc/core/ADT/feature/Reader.h>
#include <nncc/core/ADT/feature/Accessor.h>
#include <nncc/core/ADT/kernel/Shape.h>
#include <nncc/core/ADT/kernel/Reader.h>
-#include <nncc/core/ADT/PadInfo.h>
-#include <nncc/core/ADT/StrideInfo.h>
-
namespace nnop
{
const nncc::core::ADT::feature::Reader<InputDType> &in_data,
const nncc::core::ADT::kernel::Shape &ker_shape,
const nncc::core::ADT::kernel::Reader<KernelDType> &ker_data,
- const nncc::core::ADT::PadInfo &pad_info, const nncc::core::ADT::StrideInfo &stride_info)
+ const PadInfo &pad_info, const StrideInfo &stride_info)
{
for (uint32_t out_ch = 0; out_ch < out_shape.depth(); ++out_ch)
{
--- /dev/null
+#ifndef __NNOP_PAD_INFO_H__
+#define __NNOP_PAD_INFO_H__
+
+#include <cstdint>
+
+namespace nnop
+{
+
+class PadInfo
+{
+public:
+ PadInfo(uint32_t top, uint32_t bottom, uint32_t left, uint32_t right)
+ : _top{top}, _bottom{bottom}, _left{left}, _right{right}
+ {
+ // DO NOTHING
+ }
+
+public:
+ uint32_t top(void) const { return _top; }
+ uint32_t bottom(void) const { return _bottom; }
+ uint32_t left(void) const { return _left; }
+ uint32_t right(void) const { return _right; }
+
+private:
+ uint32_t _top;
+ uint32_t _bottom;
+ uint32_t _left;
+ uint32_t _right;
+};
+
+} // namespace nnop
+
+#endif // __NNCC_CORE_PAD_INFO_H__
--- /dev/null
+#ifndef __NNOP_STRIDE_INFO_H__
+#define __NNOP_STRIDE_INFO_H__
+
+#include <cstdint>
+
+namespace nnop
+{
+
+class StrideInfo
+{
+public:
+ StrideInfo(uint32_t vertical, uint32_t horizontal) : _vertical{vertical}, _horizontal{horizontal}
+ {
+ // DO NOTHING
+ }
+
+public:
+ uint32_t vertical(void) const { return _vertical; }
+ uint32_t horizontal(void) const { return _horizontal; }
+
+private:
+ uint32_t _horizontal;
+ uint32_t _vertical;
+};
+
+} // namespace nncc
+
+#endif // __NNOP_STRIDE_INFO_H__
#include <gtest/gtest.h>
+using namespace nnop;
using namespace nncc::core::ADT;
TEST(CONV2D, conv_1)
--- /dev/null
+#include "nnop/PadInfo.h"
+
+#include <gtest/gtest.h>
+
+TEST(PAD_INFO, explicit_constructor)
+{
+ const uint32_t top = 3;
+ const uint32_t bottom = 4;
+ const uint32_t left = 5;
+ const uint32_t right = 6;
+
+ nnop::PadInfo pad_info{top, bottom, left, right};
+
+ ASSERT_EQ(pad_info.top(), top);
+ ASSERT_EQ(pad_info.bottom(), bottom);
+ ASSERT_EQ(pad_info.left(), left);
+ ASSERT_EQ(pad_info.right(), right);
+}
--- /dev/null
+#include "nnop/StrideInfo.h"
+
+#include <gtest/gtest.h>
+
+TEST(STRIDE_INFO, explicit_constructor)
+{
+ const uint32_t vertical = 3;
+ const uint32_t horizontal = 4;
+
+ nnop::StrideInfo stride_info{vertical, horizontal};
+
+ ASSERT_EQ(stride_info.vertical(), vertical);
+ ASSERT_EQ(stride_info.horizontal(), horizontal);
+}