Rename xnn_init_*_config to xnn_get_*_config #8594
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Rename xnn_init_config to xnn_get_config
I think this both better reflects what these functions are doing, and also solves a minor problem I have: I'm trying to enable stronger testing of the configs, which is most easily implemented by allowing
xnn_get_hardware_config's return value to be changed via anxnn_set_hardware_config(...)function. In order to implement this, I'd like to have:xnn_init_hardware_configto return the "real" hardware configuration based on cpuinfo,xnn_get_hardware_configto return the global hardware config (by default, equal toxnn_init_hardware_config,xnn_set_hardware_config, which allows changing the global hardware config.Renaming is not necessary for this, but I do think it's slightly nicer this way, and I do think
xnn_get_*_configis a more appropriate name for the functions we actually have now.