Skip to content

Commit

Permalink
added comment about config copy
Browse files Browse the repository at this point in the history
Signed-off-by: Vladimir Paramuzov <[email protected]>
  • Loading branch information
vladimir-paramuzov committed Jan 24, 2025
1 parent ac836c9 commit 73cf4ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/inference/tests/unit/config_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,10 @@ static constexpr Property<std::string, PropertyMutability::RW> high_level_proper
static constexpr Property<std::string, PropertyMutability::RW> low_level_property{"LOW_LEVEL_PROPERTY"};
static constexpr Property<uint8_t, PropertyMutability::RW> release_internal_property{"RELEASE_INTERNAL_PROPERTY"};
static constexpr Property<uint8_t, PropertyMutability::RW> debug_property{"DEBUG_PROPERTY"};
static constexpr Property<int32_t, PropertyMutability::RW> debug_global_property{"DEBUG_GLOBAL_PROPERTY"};

#ifdef ENABLE_DEBUG_CAPS
static constexpr Property<int32_t, PropertyMutability::RW> debug_global_property{"DEBUG_GLOBAL_PROPERTY"};
#endif

struct EmptyTestConfig : public ov::PluginConfig {
std::vector<std::string> get_supported_properties() const {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,11 @@ struct ExecutionConfig : public ov::PluginConfig {
explicit ExecutionConfig(const ov::AnyMap& properties) : ExecutionConfig() { set_property(properties); }
explicit ExecutionConfig(const ov::AnyMap::value_type& property) : ExecutionConfig() { set_property(property); }

// Default operators copy config as is including finalized flag state
// In case if the config need updates after finalization clone() method shall be used as it resets finalized flag value.
// That's needed to avoid unexpected options update as we call finalization twice: in transformation pipeline
// and in cldnn::program c-tor (which is needed to handle unit tests mainly). So this second call may cause unwanted side effects
// if config is not marked as finalized, which could have easily happened if copy operator reset finalization flag
ExecutionConfig(const ExecutionConfig& other);
ExecutionConfig& operator=(const ExecutionConfig& other);
ExecutionConfig clone() const;
Expand Down

0 comments on commit 73cf4ac

Please sign in to comment.