Use libcpuid for detect optimal threads count.

This commit is contained in:
XMRig 2017-05-03 13:48:08 +03:00
parent 0a6d70c499
commit f329410940
9 changed files with 180 additions and 87 deletions

9
cpu.h
View file

@ -25,9 +25,13 @@
#define __CPU_H__
struct cpu_info {
int count;
int total_cores;
int total_logical_cpus;
int flags;
char brand[48];
int sockets;
int l2_cache;
int l3_cache;
char brand[64];
};
extern struct cpu_info cpu_info;
@ -40,7 +44,6 @@ enum cpu_flags {
};
void cpu_init();
int get_optimal_threads_count();
int affine_to_cpu_mask(int id, unsigned long mask);