diff --git a/CMakeLists.txt b/CMakeLists.txt index e35d643e..1a6aaa9d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -118,8 +118,8 @@ if (UNIX) else() install(FILES ${CMAKE_BINARY_DIR}/$<$:Release>$<$:Debug>/ion-core.dll DESTINATION bin) install(FILES ${CMAKE_BINARY_DIR}/$<$:Release>$<$:Debug>/ion-core.lib DESTINATION lib) - - # These lines is for backward compatibility. + + # These lines is for backward compatibility. # TODO: Deprecate old name of dll/lib. install(FILES ${CMAKE_BINARY_DIR}/$<$:Release>$<$:Debug>/ion-core.dll DESTINATION bin RENAME ion.dll) install(FILES ${CMAKE_BINARY_DIR}/$<$:Release>$<$:Debug>/ion-core.lib DESTINATION lib RENAME ion.lib) @@ -152,7 +152,7 @@ endif() # Packaging # if (UNIX) - set(CPACK_GENERATOR "DEB") + set(CPACK_GENERATOR "TGZ" "DEB") set(CPACK_DEBIAN_FILE_NAME DEB-DEFAULT) set(CPACK_DEBIAN_PACKAGE_MAINTAINER "Fixstars Corporation Inc.") configure_file(${CMAKE_SOURCE_DIR}/ion-kit.pc.in ${CMAKE_BINARY_DIR}/ion-kit.pc @ONLY) @@ -167,4 +167,4 @@ message(STATUS "Version: ${GIT_DESCRIBE_RESULT}") string(STRIP "${GIT_DESCRIBE_RESULT}" ION_KIT_VERSION_S) string(REPLACE "v" "" ION_KIT_VERSION ${ION_KIT_VERSION_S}) set(CPACK_PACKAGE_VERSION ${ION_KIT_VERSION}) -include(CPack) \ No newline at end of file +include(CPack) diff --git a/include/ion/port_map.h b/include/ion/port_map.h index 2ce02f8a..c6c4c3e8 100644 --- a/include/ion/port_map.h +++ b/include/ion/port_map.h @@ -1,12 +1,37 @@ #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)); + } +}; + +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 + namespace ion { /** @@ -14,24 +39,6 @@ namespace ion { */ class PortMap { - using key_t = std::tuple; - - struct key_hash : public std::unary_function - { - std::size_t operator()(const key_t& k) const - { - return std::hash{}(std::get<0>(k)) ^ std::hash{}(std::get<1>(k)); - } - }; - - struct key_equal : public std::binary_function - { - bool operator()(const key_t& v0, const key_t& v1) const - { - return (std::get<0>(v0) == std::get<0>(v1) && std::get<1>(v0) == std::get<1>(v1)); - } - }; - public: template @@ -142,7 +149,7 @@ class PortMap { return param_func_.at(k); } - std::unordered_map>, key_hash, key_equal> get_output_buffer() const { + std::unordered_map, std::vector>> get_output_buffer() const { return output_buffer_; } @@ -154,7 +161,7 @@ class PortMap { std::unordered_map param_expr_; std::unordered_map param_func_; - std::unordered_map>, key_hash, key_equal> output_buffer_; + std::unordered_map, std::vector>> output_buffer_; Halide::ParamMap param_map_; };