From ca8e31ff1802f2eadc23a7f8266e8b4a05f4a477 Mon Sep 17 00:00:00 2001
From: Yige Hu <yige-hu@users.noreply.github.com>
Date: Tue, 27 Feb 2018 17:14:58 -0600
Subject: [PATCH] Fixed a g++ explicit constructor compatibility error for
 unordered_set. (#935)

* Fixed a g++ explicit constructor compatibility error for unordered_set.

* Change std::unordered_set<std::basic_string<char>>() to
std::unordered_set<std::string>().
---
 include/tvm/build_module.h  |  3 ++-
 src/codegen/build_module.cc | 18 ++++++++++++------
 2 files changed, 14 insertions(+), 7 deletions(-)

diff --git a/include/tvm/build_module.h b/include/tvm/build_module.h
index d4186e8f8..3fb55ae16 100644
--- a/include/tvm/build_module.h
+++ b/include/tvm/build_module.h
@@ -40,7 +40,8 @@ struct Target {
          int thread_warp_size,
          const std::unordered_set<std::string>& keys,
          const std::vector<std::string>& options,
-         const std::unordered_set<std::string>& libs = {}) :
+         const std::unordered_set<std::string>& libs =
+           std::unordered_set<std::string>()) :
     target_name(target_name),
     device_type(device_type),
     max_num_threads(max_num_threads),
diff --git a/src/codegen/build_module.cc b/src/codegen/build_module.cc
index cca09a966..e7f0cd41b 100644
--- a/src/codegen/build_module.cc
+++ b/src/codegen/build_module.cc
@@ -85,25 +85,29 @@ namespace target {
 Target llvm() {
   std::unordered_set<std::string> keys({ "llvm", "cpu" });
   std::vector<std::string> options;
-  return Target("llvm", kDLCPU, 512, 1, keys, options, {});
+  return Target("llvm", kDLCPU, 512, 1, keys, options,
+           std::unordered_set<std::string>());
 }
 
 Target cuda() {
   std::unordered_set<std::string> keys({ "cuda", "gpu" });
   std::vector<std::string> options;
-  return Target("cuda", kDLGPU, 512, 32, keys, options, {});
+  return Target("cuda", kDLGPU, 512, 32, keys, options,
+           std::unordered_set<std::string>());
 }
 
 Target rocm() {
   std::unordered_set<std::string> keys({ "rocm", "gpu" });
   std::vector<std::string> options;
-  return Target("rocm", kDLROCM, 256, 1, keys, options, {});
+  return Target("rocm", kDLROCM, 256, 1, keys, options,
+           std::unordered_set<std::string>());
 }
 
 Target metal() {
   std::unordered_set<std::string> keys({ "gpu" });
   std::vector<std::string> options;
-  return Target("metal", kDLMetal, 256, 1, keys, options, {});
+  return Target("metal", kDLMetal, 256, 1, keys, options,
+           std::unordered_set<std::string>());
 }
 
 Target rasp() {
@@ -114,7 +118,8 @@ Target rasp() {
     "-mcpu=cortex-a53",
     "-mattr=+neon"
   });
-  return Target("llvm", kDLCPU, 512, 1, keys, options, {});
+  return Target("llvm", kDLCPU, 512, 1, keys, options,
+           std::unordered_set<std::string>());
 }
 
 Target mali() {
@@ -129,7 +134,8 @@ Target mali() {
 Target stackvm() {
   std::unordered_set<std::string> keys({ "stackvm", "cpu" });
   std::vector<std::string> options;
-  return Target("stackvm", kDLCPU, 512, 1, keys, options, {});
+  return Target("stackvm", kDLCPU, 512, 1, keys, options,
+           std::unordered_set<std::string>());
 }
 }  // namespace target
 
-- 
GitLab