Removing unneeded branch in server.cpp example and moving get_numa_affinity and making it static
This commit is contained in:
parent
d47f232fc1
commit
783b7ca02d
2 changed files with 8 additions and 15 deletions
|
@ -2243,11 +2243,6 @@ static void server_params_parse(int argc, char **argv, server_params &sparams,
|
|||
else { invalid_param = true; break; }
|
||||
}
|
||||
}
|
||||
|
||||
else if (arg == "--numa")
|
||||
{
|
||||
params.numa = GGML_NUMA_STRATEGY_DISABLED;
|
||||
}
|
||||
else if (arg == "--embedding")
|
||||
{
|
||||
params.embedding = true;
|
||||
|
|
18
ggml.c
18
ggml.c
|
@ -1951,7 +1951,14 @@ inline static void ggml_critical_section_end(void) {
|
|||
atomic_fetch_sub(&g_state_barrier, 1);
|
||||
}
|
||||
|
||||
cpu_set_t ggml_get_numa_affinity(void); // get cpuset from numactl
|
||||
static cpu_set_t ggml_get_numa_affinity(void) {
|
||||
cpu_set_t cpuset;
|
||||
pthread_t thread;
|
||||
thread = pthread_self();
|
||||
CPU_ZERO(&cpuset);
|
||||
pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);
|
||||
return cpuset;
|
||||
}
|
||||
|
||||
void ggml_numa_init(uint32_t numa_flag) {
|
||||
if (g_state.numa.n_nodes > 0) {
|
||||
|
@ -2031,15 +2038,6 @@ void ggml_numa_init(uint32_t numa_flag) {
|
|||
#endif
|
||||
}
|
||||
|
||||
cpu_set_t ggml_get_numa_affinity(void) {
|
||||
cpu_set_t cpuset;
|
||||
pthread_t thread;
|
||||
thread = pthread_self();
|
||||
CPU_ZERO(&cpuset);
|
||||
pthread_getaffinity_np(thread, sizeof(cpu_set_t), &cpuset);
|
||||
return cpuset;
|
||||
}
|
||||
|
||||
bool ggml_is_numa(void) {
|
||||
return g_state.numa.n_nodes > 1;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue