Commit ca8e31ff by Yige Hu Committed by Tianqi Chen

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>().
parent f4b063e9
......@@ -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),
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment