[GNA] fix: embedded export is available for embedded targets only (#17105)
* fix: embedded export is available for embedded targets only * [GNA] functional tests fix - embedded export should NOT be possible on non-embedded target * [GNA] tests added/justified to process both negative and positive path
This commit is contained in:
parent
72906ca242
commit
9c01de4b6e
@ -149,9 +149,6 @@ void Config::UpdateFromMap(const std::map<std::string, std::string>& config) {
|
||||
set_target(StringToDevice(value));
|
||||
} else if (key == GNA_CONFIG_KEY(COMPILE_TARGET)) {
|
||||
const auto target = StringToDevice(value);
|
||||
if (!embedded_export_path.empty() && !IsEmbeddedDevice(target)) {
|
||||
THROW_GNA_EXCEPTION << "Target device for embedded export should be one of embedded devices";
|
||||
}
|
||||
check_compatibility(ov::intel_gna::compile_target.name());
|
||||
set_target(target);
|
||||
} else if (key == GNA_CONFIG_KEY(COMPACT_MODE) || key == ov::intel_gna::memory_reuse) {
|
||||
@ -312,6 +309,9 @@ void Config::AdjustKeyMapValues() {
|
||||
}
|
||||
IE_ASSERT(!device_mode.empty());
|
||||
keyConfigMap[ov::intel_gna::execution_mode.name()] = device_mode;
|
||||
if (!embedded_export_path.empty() && !IsEmbeddedDevice(target->get_user_set_execution_target())) {
|
||||
THROW_GNA_EXCEPTION << "Target device for embedded export should be one of embedded devices";
|
||||
}
|
||||
keyConfigMap[GNA_CONFIG_KEY(EXEC_TARGET)] = DeviceToString(target->get_user_set_execution_target());
|
||||
keyConfigMap[GNA_CONFIG_KEY(COMPILE_TARGET)] = DeviceToString(target->get_user_set_compile_target());
|
||||
keyConfigMap[ov::intel_gna::memory_reuse.name()] =
|
||||
|
@ -341,10 +341,21 @@ TEST(OVClassBasicPropsTest, smoke_SetConfigAfterCreatedLogLevel) {
|
||||
ASSERT_THROW(core.set_property("GNA", {{ov::log::level.name(), "NO"}}), ov::Exception);
|
||||
}
|
||||
|
||||
TEST(OVClassBasicPropsTest, smoke_SetConfigAfterCreatedFwModelPath) {
|
||||
TEST(OVClassBasicPropsTest, smoke_SetConfigAfterCreatedFwModelPathNegative) {
|
||||
ov::Core core;
|
||||
std::string path = "";
|
||||
|
||||
OV_ASSERT_NO_THROW(core.set_property("GNA", ov::intel_gna::execution_target(ov::intel_gna::HWGeneration::GNA_3_5)));
|
||||
OV_ASSERT_NO_THROW(core.set_property("GNA", ov::intel_gna::firmware_model_image_path("model.bin")));
|
||||
ASSERT_THROW(path = core.get_property("GNA", ov::intel_gna::firmware_model_image_path), ov::Exception);
|
||||
}
|
||||
|
||||
TEST(OVClassBasicPropsTest, smoke_SetConfigAfterCreatedFwModelPathPositive) {
|
||||
ov::Core core;
|
||||
std::string path = "";
|
||||
|
||||
OV_ASSERT_NO_THROW(
|
||||
core.set_property("GNA", ov::intel_gna::execution_target(ov::intel_gna::HWGeneration::GNA_3_5_E)));
|
||||
OV_ASSERT_NO_THROW(core.set_property("GNA", ov::intel_gna::firmware_model_image_path("model.bin")));
|
||||
OV_ASSERT_NO_THROW(path = core.get_property("GNA", ov::intel_gna::firmware_model_image_path));
|
||||
ASSERT_EQ("model.bin", path);
|
||||
|
Loading…
Reference in New Issue
Block a user