Skip to content

Commit aec2c69

Browse files
authored
[NVIDIA]: return device architecture (#564)
* [NVIDIA]: return device architecture for device specified by DEVICE_ID config * Replace arch by capabilities
1 parent 713974b commit aec2c69

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

modules/nvidia_plugin/src/cuda_plugin.cpp

+8-3
Original file line numberDiff line numberDiff line change
@@ -228,9 +228,14 @@ InferenceEngine::Parameter Plugin::GetMetric(const std::string& name,
228228
} else if (METRIC_KEY(IMPORT_EXPORT_SUPPORT) == name) {
229229
IE_SET_METRIC_RETURN(IMPORT_EXPORT_SUPPORT, true);
230230
} else if (METRIC_KEY(DEVICE_ARCHITECTURE) == name) {
231-
// TODO: return device architecture for device specified by DEVICE_ID config
232-
std::string arch = "CUDA";
233-
IE_SET_METRIC_RETURN(DEVICE_ARCHITECTURE, arch);
231+
const std::string deviceId = _cfg.Get(CONFIG_KEY(DEVICE_ID));
232+
CUDA::Device device{std::stoi(deviceId)};
233+
const auto& props = device.props();
234+
std::stringstream ss;
235+
ss << "NVIDIA: ";
236+
ss << "v" << props.major;
237+
ss << "." << props.minor;
238+
IE_SET_METRIC_RETURN(DEVICE_ARCHITECTURE, ss.str());
234239
} else if (METRIC_KEY(OPTIMIZATION_CAPABILITIES) == name) {
235240
// TODO: fill actual list of supported capabilities: e.g. Cuda device supports only FP32
236241
std::vector<std::string> capabilities = {METRIC_VALUE(FP32) /*, TEMPLATE_METRIC_VALUE(HARDWARE_CONVOLUTION)*/};

0 commit comments

Comments
 (0)