Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cpuid: limit search to current values #8

Merged
merged 3 commits into from
Jun 15, 2023

Conversation

andrewjj20
Copy link
Contributor

Improved the APIs to make it clearer when leafs are not present. There are a few ways to identify when to stop scanning mentioned in the manual. For displaying facts, the code will now not only use a zero check in some cases, It will also pay attention to the advertized limits from the CPU.

Improved the APIs to make it clearer when leafs are not present. There
are a few ways to identify when to stop scanning mentioned in the
manual. For displaying facts, the code will now not only use a zero
check in some cases, It will also pay attention to the advertized limits
from the CPU.
@andrewjj20 andrewjj20 self-assigned this Apr 17, 2023
src/layout.rs Outdated
Comment on lines 118 to 124
if !is_empty_leaf(&cpuid) {
if let Some(cpuid) = cpuid.get_cpuid(leaf, 0) {
vec![cpuid]
} else {
vec![]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could this function that is an if let/else be more idiomatically expressed with a match?

match cpuid.get_cpuid(leaf, 0) {
    Some(cpuid) => vec![cpuid],
    None => vec![]
}

it would probably be good to also disambiguate the names for the input and output cpuid's

@andrewjj20 andrewjj20 merged commit 68c6bca into ScaleComputing:main Jun 15, 2023
@andrewjj20 andrewjj20 deleted the limit_search branch June 15, 2023 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants