MCPcopy Create free account
hub / github.com/Niko1221/Strata / expect_affinity

Function expect_affinity

engine/src/kernels/cpu/pool_affinity_linux_test.cpp:110–122  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108};
109
110static bool expect_affinity(const std::vector<int>& expected, const char* label) {
111 std::vector<int> actual;
112 if (!get_affinity(actual)) {
113 std::fprintf(stderr, "Linux affinity test: %s: cannot query current affinity\n", label);
114 return false;
115 }
116 if (actual != expected) {
117 std::fprintf(stderr, "Linux affinity test: %s: expected %zu CPUs, observed %zu\n",
118 label, expected.size(), actual.size());
119 return false;
120 }
121 return true;
122}
123
124static bool round_trip_full_mask(const std::vector<int>& allowed) {
125 const int target = allowed.front();

Callers 7

round_trip_full_maskFunction · 0.85
round_trip_sparse_nestedFunction · 0.85
round_trip_high_cpuFunction · 0.85
negative_cpu_is_noopFunction · 0.85
worker_thread_can_pinFunction · 0.85
dangling_else_guardFunction · 0.85
mainFunction · 0.85

Calls 2

get_affinityFunction · 0.85
sizeMethod · 0.45

Tested by

no test coverage detected