Skip to content

Commit

Permalink
Merge pull request #447 from darma-mpi-backend/446-missing-hash-function
Browse files Browse the repository at this point in the history
  • Loading branch information
lifflander authored Sep 5, 2019
2 parents 68e7d81 + 0124075 commit 0bf6d24
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/vt/vrt/collection/balance/lb_common.h
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,29 @@ enum struct Statistic : int8_t {
// InternalEdgesCardinality
};

extern std::unordered_map<Statistic,std::string> lb_stat_name_;

} /* end namespace lb */

}}} /* end namespace vt::vrt::collection */

namespace std {

using StatisticType = vt::vrt::collection::lb::Statistic;

template <>
struct hash<StatisticType> {
size_t operator()(StatisticType const& in) const {
using StatisticUnderType = typename std::underlying_type<StatisticType>::type;
auto const val = static_cast<StatisticUnderType>(in);
return std::hash<StatisticUnderType>()(val);
}
};

} /* end namespace std */

namespace vt { namespace vrt { namespace collection { namespace lb {

extern std::unordered_map<Statistic,std::string> lb_stat_name_;

}}}} /* end namespace vt::vrt::collection::lb */

#endif /*INCLUDED_VT_VRT_COLLECTION_BALANCE_LB_COMMON_H*/

0 comments on commit 0bf6d24

Please sign in to comment.