Skip to content

Commit

Permalink
[intel-npu] config: adding interface function to get optiondescriptor…
Browse files Browse the repository at this point in the history
… from config; renaming getSupportedProperties for better clarity
  • Loading branch information
csoka committed Oct 3, 2024
1 parent ab13d4a commit f7dd279
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -389,7 +389,7 @@ class OptionsDesc final {
void reset();

std::vector<std::string> getSupported(bool includePrivate = false) const;
std::vector<ov::PropertyName> getSupportedProperties(bool includePrivate = false) const;
std::vector<ov::PropertyName> getSupportedOptions(bool includePrivate = false) const;

details::OptionConcept get(std::string_view key, OptionMode mode = OptionMode::Both) const;
void walk(std::function<void(const details::OptionConcept&)> cb) const;
Expand Down Expand Up @@ -457,6 +457,7 @@ class Config final {

bool hasOpt(std::string_view key) const;
bool isOptPublic(std::string_view key) const;
details::OptionConcept getOpt(std::string_view key) const;

template <class Opt>
bool has() const;
Expand Down
6 changes: 5 additions & 1 deletion src/plugins/intel_npu/src/al/src/config/config.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -197,7 +197,7 @@ std::vector<std::string> OptionsDesc::getSupported(bool includePrivate) const {
return res;
}

std::vector<ov::PropertyName> OptionsDesc::getSupportedProperties(bool includePrivate) const {
std::vector<ov::PropertyName> OptionsDesc::getSupportedOptions(bool includePrivate) const {
std::vector<ov::PropertyName> res;
res.reserve(_impl.size());

Expand Down Expand Up @@ -228,6 +228,10 @@ bool Config::hasOpt(std::string_view key) const {
return _desc->has(key);
}

details::OptionConcept Config::getOpt(std::string_view key) const {
return _desc->get(key);
}

bool Config::isOptPublic(std::string_view key) const {
auto log = Logger::global().clone("Config");
if (_desc->has(key)) {
Expand Down
3 changes: 2 additions & 1 deletion src/plugins/intel_npu/src/plugin/src/plugin.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ void Plugin::init_options(compilerVersion comp_ver) {
// parse again env_variables after backend is initialized to get backend proprieties
_globalConfig.parseEnvVars();

std::vector<ov::PropertyName> sup_props = _options->getSupportedProperties();
/// DEBUG TODO:remove
std::vector<ov::PropertyName> sup_props = _options->getSupportedOptions();
std::cout << "Registered options: " << std::endl;
for (const std::string& prop : sup_props) {
std::cout << prop << std::endl;
Expand Down

0 comments on commit f7dd279

Please sign in to comment.