MCPcopy Create free account
hub / github.com/MITK/MITK / parseCUDADevice

Function parseCUDADevice

Modules/PythonSegmentation/src/mitknnInteractiveTool.cpp:40–49  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38namespace
39{
40 std::optional<int> parseCUDADevice(const std::string& gpuBackend)
41 {
42 const std::regex regex(R"(^\s*cuda:(\d+)\s*$)");
43 std::smatch match;
44
45 if (std::regex_match(gpuBackend, match, regex))
46 return std::stoi(match[1].str());
47
48 return std::nullopt;
49 }
50
51 mitk::IPreferences* GetPreferences()
52 {

Callers 1

GetCUDADeviceInfoMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected