[GPU] Update caching properties for GPU (#15463)

This commit is contained in:
Nadezhda Ageeva 2023-02-09 13:57:38 +04:00 committed by GitHub
parent 2769e22767
commit ccebc629e2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 40 additions and 2 deletions

View File

@ -524,10 +524,11 @@ Parameter Plugin::GetMetric(const std::string& name, const std::map<std::string,
IE_SET_METRIC_RETURN(IMPORT_EXPORT_SUPPORT, true);
} else if (name == ov::caching_properties) {
std::vector<ov::PropertyName> cachingProperties;
cachingProperties.push_back(ov::PropertyName(ov::intel_gpu::uarch_version.name(), PropertyMutability::RO));
cachingProperties.push_back(ov::PropertyName(ov::device::architecture.name(), PropertyMutability::RO));
cachingProperties.push_back(ov::PropertyName(ov::intel_gpu::execution_units_count.name(), PropertyMutability::RO));
cachingProperties.push_back(ov::PropertyName(ov::intel_gpu::driver_version.name(), PropertyMutability::RO));
cachingProperties.push_back(ov::PropertyName(ov::intel_gpu::device_id.name(), PropertyMutability::RO));
cachingProperties.push_back(ov::PropertyName(ov::inference_precision.name(), PropertyMutability::RW));
cachingProperties.push_back(ov::PropertyName(ov::hint::execution_mode.name(), PropertyMutability::RW));
return decltype(ov::caching_properties)::value_type(cachingProperties);
} else if (name == ov::intel_gpu::driver_version) {
return decltype(ov::intel_gpu::driver_version)::value_type {device_info.driver_version};

View File

@ -11,6 +11,7 @@ addIeTargetTest(
${CMAKE_CURRENT_SOURCE_DIR}
INCLUDES
${CMAKE_CURRENT_SOURCE_DIR}
$<TARGET_PROPERTY:openvino_intel_gpu_plugin,SOURCE_DIR>/include/
DEPENDENCIES
openvino_intel_gpu_plugin
LINK_LIBRARIES

View File

@ -6,6 +6,8 @@
#include "behavior/ov_plugin/core_integration.hpp"
#include "openvino/runtime/intel_gpu/properties.hpp"
#include "cpp_interfaces/interface/ie_internal_plugin_config.hpp"
#include "intel_gpu/runtime/internal_properties.hpp"
#ifdef _WIN32
# include "gpu/gpu_context_api_dx.hpp"
@ -811,6 +813,40 @@ INSTANTIATE_TEST_SUITE_P(smoke_OVClassHeteroExecutableNetworkGetMetricTest,
OVClassLoadNetworkAfterCoreRecreateTest,
::testing::Values("GPU"));
using OVClassGetMetricTest_CACHING_PROPERTIES = OVClassBaseTestP;
TEST_P(OVClassGetMetricTest_CACHING_PROPERTIES, GetMetricAndPrintNoThrow) {
ov::Core ie = createCoreWithTemplate();
std::vector<ov::PropertyName> caching_properties = {};
const std::vector<ov::PropertyName> expected_properties = {
ov::device::architecture.name(),
ov::intel_gpu::execution_units_count.name(),
ov::intel_gpu::driver_version.name(),
ov::inference_precision.name(),
ov::hint::execution_mode.name(),
};
ASSERT_NO_THROW(caching_properties = ie.get_property(target_device, ov::caching_properties));
std::cout << "GPU Caching properties: " << std::endl;
for (auto& prop : caching_properties) {
std::cout << prop << std::endl;
}
ASSERT_EQ(caching_properties.size(), expected_properties.size());
for (const auto& property_name : expected_properties) {
ASSERT_TRUE(std::find(caching_properties.begin(),
caching_properties.end(),
property_name) != caching_properties.end());
}
OV_ASSERT_PROPERTY_SUPPORTED(ov::caching_properties);
}
INSTANTIATE_TEST_SUITE_P(nightly_OVClassGetMetricTest,
OVClassGetMetricTest_CACHING_PROPERTIES,
::testing::Values("GPU"));
// GetConfig / SetConfig for specific device
INSTANTIATE_TEST_SUITE_P(