diff --git a/include/ion/node.h b/include/ion/node.h
index 55db1d2f..72d40f0a 100644
--- a/include/ion/node.h
+++ b/include/ion/node.h
@@ -91,35 +91,19 @@ class Node {
return impl_->id;
}
- std::string& id() {
- return impl_->id;
- }
-
const std::string& name() const {
return impl_->name;
}
- std::string& name(){
- return impl_->name;
- }
-
const Halide::Target& target() const {
return impl_->target;
}
- Halide::Target& target() {
- return impl_->target;
- }
-
const std::vector& params() const {
return impl_->params;
}
- std::vector& params() {
- return impl_->params;
- }
-
- std::vector iports() const {
+ std::vector iports() const {
std::vector iports;
for (const auto& p: impl_->ports) {
if (std::count_if(p.impl_->succ_chans.begin(), p.impl_->succ_chans.end(),
diff --git a/include/ion/port_map.h b/include/ion/port_map.h
index 625185a2..82a05dc2 100644
--- a/include/ion/port_map.h
+++ b/include/ion/port_map.h
@@ -1,38 +1,10 @@
#ifndef ION_PORT_MAP_H
#define ION_PORT_MAP_H
-#include
#include
-#include
#include
-#include "ion/util.h"
-
-namespace std
-{
-
-template<>
-struct hash>
-{
- std::size_t operator()(const tuple& k) const noexcept
- {
- return std::hash{}(std::get<0>(k)) ^ std::hash{}(std::get<1>(k)) ^ std::hash{}(std::get<2>(k));
- }
-};
-
-template<>
-struct equal_to>
-{
- bool operator()(const tuple& v0, const tuple& v1) const
- {
- return (std::get<0>(v0) == std::get<0>(v1) && std::get<1>(v0) == std::get<1>(v1) && std::get<2>(v0) == std::get<2>(v1));
- }
-};
-
-} // std
-
-
namespace ion {
/**
@@ -41,117 +13,28 @@ namespace ion {
class PortMap {
public:
-
- PortMap() : dirty_(false)
- {
- }
-
- /**
- * Set the scalar value against to the port.
- * Template type T is allowed to be one of the following.
- * - bool
- * - uint8_t
- * - uint16_t
- * - uint32_t
- * - uint64_t
- * - int8_t
- * - int16_t
- * - int32_t
- * - int64_t
- * - float
- * - double
- * @arg p: The port object which value is assigned.
- * @arg v: Actual value to be mapped to the port.
- */
template
+ [[deprecated("Port::bind can be used instead of PortMap.")]]
void set(Port port, T v) {
auto& buf(scalar_buffer_[argument_name(port.pred_id(), port.pred_name(), port.index())]);
buf.resize(sizeof(v));
std::memcpy(buf.data(), &v, sizeof(v));
port.bind(reinterpret_cast(buf.data()));
- dirty_ = true;
}
- /**
- * Set the vector value against to the port.
- * Following type value is allowed to specified:
- * - bool
- * - uint8_t
- * - uint16_t
- * - uint32_t
- * - uint64_t
- * - int8_t
- * - int16_t
- * - int32_t
- * - int64_t
- * - float
- * - double
- * @arg p: The port object which value is assigned.
- * @arg buf: Actual value to be mapped to the port.
- * Buffer dimension should be matched with port's one.
- */
template
+ [[deprecated("Port::bind can be used instead of PortMap.")]]
void set(Port port, Halide::Buffer& buf) {
- if (port.has_pred()) {
- // This is just an output.
- output_buffer_[std::make_tuple(port.pred_id(), port.pred_name(), port.index())] = { buf };
- port.bind(buf);
- } else {
- port.bind(buf);
- }
-
- dirty_ = true;
+ port.bind(buf);
}
- /**
- * Set the vector of the vector values against to the port.
- * Following type value is allowed to specified:
- * - bool
- * - uint8_t
- * - uint16_t
- * - uint32_t
- * - uint64_t
- * - int8_t
- * - int16_t
- * - int32_t
- * - int64_t
- * - float
- * - double
- * @arg p: The port object which value is assigned.
- * @arg bufs: Actual value to be mapped to the port.
- * Buffer dimension should be matched with port's one.
- */
template
+ [[deprecated("Port::bind can be used instead of PortMap.")]]
void set(Port port, const std::vector> &bufs) {
- if (port.has_pred()) {
- // This is just an output.
- for (auto buf : bufs) {
- output_buffer_[std::make_tuple(port.pred_id(), port.pred_name(), port.index())].push_back(buf);
- }
- port.bind(bufs);
- } else {
- port.bind(bufs);
- }
-
- dirty_ = true;
- }
-
- std::unordered_map, std::vector>> get_output_buffer() const {
- return output_buffer_;
+ port.bind(bufs);
}
- void updated() {
- dirty_ = false;
- }
-
- bool dirty() const {
- return dirty_;
- }
-
- private:
- bool dirty_;
- std::unordered_map, std::vector>> output_buffer_;
-
+private:
std::unordered_map> scalar_buffer_;
};