MCPcopy Create free account
hub / github.com/antmachineintelligence/mtgbmcode / GetDeviceType

Function GetDeviceType

src/io/config.cpp:124–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

122}
123
124void GetDeviceType(const std::unordered_map<std::string, std::string>& params, std::string* device_type) {
125 std::string value;
126 if (Config::GetString(params, "device_type", &value)) {
127 std::transform(value.begin(), value.end(), value.begin(), Common::tolower);
128 if (value == std::string("cpu")) {
129 *device_type = "cpu";
130 } else if (value == std::string("gpu")) {
131 *device_type = "gpu";
132 } else {
133 Log::Fatal("Unknown device type %s", value.c_str());
134 }
135 }
136}
137
138void GetTreeLearnerType(const std::unordered_map<std::string, std::string>& params, std::string* tree_learner) {
139 std::string value;

Callers 1

SetMethod · 0.70

Calls 3

transformFunction · 0.85
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected