MCPcopy Create free account
hub / github.com/bitsandbytes-foundation/bitsandbytes / adjust_num_threads

Function adjust_num_threads

csrc/cpu_ops.h:71–76  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

69}
70
71inline int adjust_num_threads(int m) {
72 int actual_nth = get_max_threads();
73 if (m == 1)
74 return actual_nth;
75 return std::max(1, (actual_nth >> 1) * 2);
76}
77
78template <typename func_t> inline void parallel_2d(int m, int n, const func_t& f) {
79 // make sure we have even num_threads

Callers 1

parallel_2dFunction · 0.85

Calls 1

get_max_threadsFunction · 0.85

Tested by

no test coverage detected