mirror of https://github.com/google/gemma.cpp.git
Use all CPU sockets when pinning threads to cores
PiperOrigin-RevId: 654800375
This commit is contained in:
parent
85cac13fb1
commit
74a6dc8f33
|
|
@ -83,9 +83,10 @@ static inline std::vector<size_t> AssignCpusFromTopology(
|
||||||
// This would result in the least amount of sharing of the last-level
|
// This would result in the least amount of sharing of the last-level
|
||||||
// cache slices. All assignments are made from Package 0.
|
// cache slices. All assignments are made from Package 0.
|
||||||
std::vector<std::vector<size_t>> clusters;
|
std::vector<std::vector<size_t>> clusters;
|
||||||
clusters.reserve(topology.packages[0].clusters.size());
|
for (auto& package : topology.packages) {
|
||||||
for (auto& cluster : topology.packages[0].clusters) {
|
for (auto& cluster : package.clusters) {
|
||||||
clusters.push_back(LpsToCpus(cluster.lps));
|
clusters.push_back(LpsToCpus(cluster.lps));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
std::vector<size_t> assigned_cpus;
|
std::vector<size_t> assigned_cpus;
|
||||||
assigned_cpus.reserve(num_workers);
|
assigned_cpus.reserve(num_workers);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue