quattor / template-library-standard

Apache License 2.0
2 stars 20 forks source link

Ensure max_threads is set for all CPUs defined under /hardware/cpu/ #161

Closed maxeem closed 2 months ago

maxeem commented 3 months ago

This was needed to avoid hitting a bug when using the get_num_of_max_threads() function.

This assumes that hyperthreading is enabled.

For CPUs that do not support hyperthreading it sets max_threads to the value of cores count.

jrha commented 3 months ago

Why not fix get_num_of_cores_max_threads to handle max_threads being undefined?

maxeem commented 3 months ago

In addition to templates changes? Or keeping old templates as they are?

I can make it default to cores count when needed, but some people might end up having less thread count by default.. which is not too bad but probably not optimal 🤷‍♂️

jrha commented 3 months ago

Yep, in addition to this change (which is fine in itself), but the schema doesn't enforce the property being present, so get_num_of_cores_max_threads shouldn't rely on it.

jrha commented 2 months ago

Rebased.