#define __COCO_IR_MAX_POOL_2D_H__
#include "coco/IR/Op.h"
+#include "coco/IR/Window2D.h"
namespace coco
{
MaxPool2D *asMaxPool2D(void) override { return this; }
const MaxPool2D *asMaxPool2D(void) const override { return this; }
+public:
+ Window2D *window(void) { return &_window; }
+ const Window2D *window(void) const { return &_window; }
+
private:
void get(const PtrLink<Op, Instr> **out) const override { *out = _op_link; }
private:
const PtrLink<Op, Instr> *const _op_link;
+
+private:
+ Window2D _window;
};
} // namespace coco
{
auto op = allocate();
+ coco::MaxPool2D *mutable_ptr = op;
+ const coco::MaxPool2D *immutable_ptr = op;
+
// uses() should be empty on construction
ASSERT_EQ(op->uses().size(), 0);
// parent() should be nullptr on construction
ASSERT_EQ(op->parent(), nullptr);
+
+ // window() SHOULD return a valid pointer
+ ASSERT_NE(mutable_ptr->window(), nullptr);
+ ASSERT_EQ(mutable_ptr->window(), immutable_ptr->window());
}
TEST_F(MaxPool2DTest, asMaxPool2D)