Code syntaxis
Auto code style in some files and update VS project properties.
This commit is contained in:
parent
86f0d9d944
commit
e3407385ab
15 changed files with 300 additions and 228 deletions
116
src/Cpu.cpp
116
src/Cpu.cpp
|
@ -41,78 +41,90 @@ int Cpu::m_totalThreads = 0;
|
|||
|
||||
int Cpu::optimalThreadsCount(int algo, bool doubleHash, int maxCpuUsage)
|
||||
{
|
||||
if (m_totalThreads == 1) {
|
||||
return 1;
|
||||
}
|
||||
if(m_totalThreads == 1)
|
||||
{
|
||||
return 1;
|
||||
}
|
||||
|
||||
int cache = 0;
|
||||
if (m_l3_cache) {
|
||||
cache = m_l2_exclusive ? (m_l2_cache + m_l3_cache) : m_l3_cache;
|
||||
}
|
||||
else {
|
||||
cache = m_l2_cache;
|
||||
}
|
||||
int cache = 0;
|
||||
if(m_l3_cache)
|
||||
{
|
||||
cache = m_l2_exclusive ? (m_l2_cache + m_l3_cache) : m_l3_cache;
|
||||
}
|
||||
else
|
||||
{
|
||||
cache = m_l2_cache;
|
||||
}
|
||||
|
||||
int count = 0;
|
||||
const int size = (algo ? 1024 : 2048) * (doubleHash ? 2 : 1);
|
||||
int count = 0;
|
||||
const int size = (algo ? 1024 : 2048) * (doubleHash ? 2 : 1);
|
||||
|
||||
if (cache) {
|
||||
count = cache / size;
|
||||
}
|
||||
else {
|
||||
count = m_totalThreads / 2;
|
||||
}
|
||||
if(cache)
|
||||
{
|
||||
count = cache / size;
|
||||
}
|
||||
else
|
||||
{
|
||||
count = m_totalThreads / 2;
|
||||
}
|
||||
|
||||
if (count > m_totalThreads) {
|
||||
count = m_totalThreads;
|
||||
}
|
||||
if(count > m_totalThreads)
|
||||
{
|
||||
count = m_totalThreads;
|
||||
}
|
||||
|
||||
if (((float) count / m_totalThreads * 100) > maxCpuUsage) {
|
||||
count = (int) ceil((float) m_totalThreads * (maxCpuUsage / 100.0));
|
||||
}
|
||||
if(((float) count / m_totalThreads * 100) > maxCpuUsage)
|
||||
{
|
||||
count = (int) ceil((float) m_totalThreads * (maxCpuUsage / 100.0));
|
||||
}
|
||||
|
||||
return count < 1 ? 1 : count;
|
||||
return count < 1 ? 1 : count;
|
||||
}
|
||||
|
||||
|
||||
void Cpu::initCommon()
|
||||
{
|
||||
struct cpu_raw_data_t raw = { 0 };
|
||||
struct cpu_id_t data = { 0 };
|
||||
struct cpu_raw_data_t raw = { 0 };
|
||||
struct cpu_id_t data = { 0 };
|
||||
|
||||
cpuid_get_raw_data(&raw);
|
||||
cpu_identify(&raw, &data);
|
||||
cpuid_get_raw_data(&raw);
|
||||
cpu_identify(&raw, &data);
|
||||
|
||||
strncpy(m_brand, data.brand_str, sizeof(m_brand) - 1);
|
||||
strncpy(m_brand, data.brand_str, sizeof(m_brand) - 1);
|
||||
|
||||
m_totalThreads = data.total_logical_cpus;
|
||||
m_sockets = m_totalThreads / data.num_logical_cpus;
|
||||
m_totalThreads = data.total_logical_cpus;
|
||||
m_sockets = m_totalThreads / data.num_logical_cpus;
|
||||
|
||||
if (m_sockets == 0) {
|
||||
m_sockets = 1;
|
||||
}
|
||||
if(m_sockets == 0)
|
||||
{
|
||||
m_sockets = 1;
|
||||
}
|
||||
|
||||
m_totalCores = data.num_cores * m_sockets;
|
||||
m_l3_cache = data.l3_cache > 0 ? data.l3_cache * m_sockets : 0;
|
||||
m_totalCores = data.num_cores * m_sockets;
|
||||
m_l3_cache = data.l3_cache > 0 ? data.l3_cache * m_sockets : 0;
|
||||
|
||||
// Workaround for AMD CPUs https://github.com/anrieff/libcpuid/issues/97
|
||||
if (data.vendor == VENDOR_AMD && data.ext_family >= 0x15 && data.ext_family < 0x17) {
|
||||
m_l2_cache = data.l2_cache * (m_totalCores / 2) * m_sockets;
|
||||
m_l2_exclusive = true;
|
||||
}
|
||||
else {
|
||||
m_l2_cache = data.l2_cache > 0 ? data.l2_cache * m_totalCores * m_sockets : 0;
|
||||
}
|
||||
// Workaround for AMD CPUs https://github.com/anrieff/libcpuid/issues/97
|
||||
if(data.vendor == VENDOR_AMD && data.ext_family >= 0x15 && data.ext_family < 0x17)
|
||||
{
|
||||
m_l2_cache = data.l2_cache * (m_totalCores / 2) * m_sockets;
|
||||
m_l2_exclusive = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
m_l2_cache = data.l2_cache > 0 ? data.l2_cache * m_totalCores * m_sockets : 0;
|
||||
}
|
||||
|
||||
# if defined(__x86_64__) || defined(_M_AMD64)
|
||||
m_flags |= X86_64;
|
||||
m_flags |= X86_64;
|
||||
# endif
|
||||
|
||||
if (data.flags[CPU_FEATURE_AES]) {
|
||||
m_flags |= AES;
|
||||
}
|
||||
if(data.flags[CPU_FEATURE_AES])
|
||||
{
|
||||
m_flags |= AES;
|
||||
}
|
||||
|
||||
if (data.flags[CPU_FEATURE_BMI2]) {
|
||||
m_flags |= BMI2;
|
||||
}
|
||||
if(data.flags[CPU_FEATURE_BMI2])
|
||||
{
|
||||
m_flags |= BMI2;
|
||||
}
|
||||
}
|
||||
|
|
75
src/Cpu.h
75
src/Cpu.h
|
@ -31,36 +31,61 @@
|
|||
class Cpu
|
||||
{
|
||||
public:
|
||||
enum Flags {
|
||||
X86_64 = 1,
|
||||
AES = 2,
|
||||
BMI2 = 4
|
||||
};
|
||||
enum Flags
|
||||
{
|
||||
X86_64 = 1,
|
||||
AES = 2,
|
||||
BMI2 = 4
|
||||
};
|
||||
|
||||
static int optimalThreadsCount(int algo, bool doubleHash, int maxCpuUsage);
|
||||
static void init();
|
||||
static void setAffinity(int id, uint64_t mask);
|
||||
static int optimalThreadsCount(int algo, bool doubleHash, int maxCpuUsage);
|
||||
static void init();
|
||||
static void setAffinity(int id, uint64_t mask);
|
||||
|
||||
static inline bool hasAES() { return (m_flags & AES) != 0; }
|
||||
static inline bool isX64() { return (m_flags & X86_64) != 0; }
|
||||
static inline const char *brand() { return m_brand; }
|
||||
static inline int cores() { return m_totalCores; }
|
||||
static inline int l2() { return m_l2_cache; }
|
||||
static inline int l3() { return m_l3_cache; }
|
||||
static inline int sockets() { return m_sockets; }
|
||||
static inline int threads() { return m_totalThreads; }
|
||||
static inline bool hasAES()
|
||||
{
|
||||
return (m_flags & AES) != 0;
|
||||
}
|
||||
static inline bool isX64()
|
||||
{
|
||||
return (m_flags & X86_64) != 0;
|
||||
}
|
||||
static inline const char* brand()
|
||||
{
|
||||
return m_brand;
|
||||
}
|
||||
static inline int cores()
|
||||
{
|
||||
return m_totalCores;
|
||||
}
|
||||
static inline int l2()
|
||||
{
|
||||
return m_l2_cache;
|
||||
}
|
||||
static inline int l3()
|
||||
{
|
||||
return m_l3_cache;
|
||||
}
|
||||
static inline int sockets()
|
||||
{
|
||||
return m_sockets;
|
||||
}
|
||||
static inline int threads()
|
||||
{
|
||||
return m_totalThreads;
|
||||
}
|
||||
|
||||
private:
|
||||
static void initCommon();
|
||||
static void initCommon();
|
||||
|
||||
static bool m_l2_exclusive;
|
||||
static char m_brand[64];
|
||||
static int m_flags;
|
||||
static int m_l2_cache;
|
||||
static int m_l3_cache;
|
||||
static int m_sockets;
|
||||
static int m_totalCores;
|
||||
static int m_totalThreads;
|
||||
static bool m_l2_exclusive;
|
||||
static char m_brand[64];
|
||||
static int m_flags;
|
||||
static int m_l2_cache;
|
||||
static int m_l3_cache;
|
||||
static int m_sockets;
|
||||
static int m_totalCores;
|
||||
static int m_totalThreads;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -56,27 +56,30 @@ void Cpu::init()
|
|||
|
||||
void Cpu::setAffinity(int id, uint64_t mask)
|
||||
{
|
||||
/*
|
||||
cpu_set_t set;
|
||||
CPU_ZERO(&set);
|
||||
|
||||
for (int i = 0; i < m_totalThreads; i++) {
|
||||
if (mask & (1UL << i)) {
|
||||
CPU_SET(i, &set);
|
||||
}
|
||||
for(int i = 0; i < m_totalThreads; i++)
|
||||
{
|
||||
if(mask & (1UL << i))
|
||||
{
|
||||
CPU_SET(i, &set);
|
||||
}
|
||||
}
|
||||
|
||||
if (id == -1) {
|
||||
# ifndef __FreeBSD__
|
||||
sched_setaffinity(0, sizeof(&set), &set);
|
||||
# endif
|
||||
} else {
|
||||
# ifndef __ANDROID__
|
||||
pthread_setaffinity_np(pthread_self(), sizeof(&set), &set);
|
||||
# else
|
||||
sched_setaffinity(gettid(), sizeof(&set), &set);
|
||||
# endif
|
||||
if(id == -1)
|
||||
{
|
||||
# ifndef __FreeBSD__
|
||||
sched_setaffinity(0, sizeof(&set), &set);
|
||||
# endif
|
||||
}
|
||||
else
|
||||
{
|
||||
# ifndef __ANDROID__
|
||||
pthread_setaffinity_np(pthread_self(), sizeof(&set), &set);
|
||||
# else
|
||||
sched_setaffinity(gettid(), sizeof(&set), &set);
|
||||
# endif
|
||||
}
|
||||
*/
|
||||
}
|
||||
#endif
|
|
@ -31,22 +31,24 @@
|
|||
void Cpu::init()
|
||||
{
|
||||
# ifdef XMRIG_NO_LIBCPUID
|
||||
SYSTEM_INFO sysinfo;
|
||||
GetSystemInfo(&sysinfo);
|
||||
SYSTEM_INFO sysinfo;
|
||||
GetSystemInfo(&sysinfo);
|
||||
|
||||
m_totalThreads = sysinfo.dwNumberOfProcessors;
|
||||
m_totalThreads = sysinfo.dwNumberOfProcessors;
|
||||
# endif
|
||||
|
||||
initCommon();
|
||||
initCommon();
|
||||
}
|
||||
|
||||
|
||||
void Cpu::setAffinity(int id, uint64_t mask)
|
||||
{
|
||||
if (id == -1) {
|
||||
SetProcessAffinityMask(GetCurrentProcess(), mask);
|
||||
}
|
||||
else {
|
||||
SetThreadAffinityMask(GetCurrentThread(), mask);
|
||||
}
|
||||
if(id == -1)
|
||||
{
|
||||
SetProcessAffinityMask(GetCurrentProcess(), mask);
|
||||
}
|
||||
else
|
||||
{
|
||||
SetThreadAffinityMask(GetCurrentThread(), mask);
|
||||
}
|
||||
}
|
||||
|
|
54
src/Mem.cpp
54
src/Mem.cpp
|
@ -35,53 +35,57 @@ int Mem::m_algo = 0;
|
|||
int Mem::m_flags = 0;
|
||||
int Mem::m_threads = 0;
|
||||
size_t Mem::m_offset = 0;
|
||||
uint8_t *Mem::m_memory = nullptr;
|
||||
uint8_t* Mem::m_memory = nullptr;
|
||||
|
||||
|
||||
cryptonight_ctx *Mem::create(int threadId)
|
||||
cryptonight_ctx* Mem::create(int threadId)
|
||||
{
|
||||
# ifndef XMRIG_NO_AEON
|
||||
if (m_algo == Options::ALGO_CRYPTONIGHT_LITE) {
|
||||
return createLite(threadId);
|
||||
}
|
||||
if(m_algo == Options::ALGO_CRYPTONIGHT_LITE)
|
||||
{
|
||||
return createLite(threadId);
|
||||
}
|
||||
# endif
|
||||
|
||||
cryptonight_ctx *ctx = reinterpret_cast<cryptonight_ctx *>(&m_memory[MEMORY - sizeof(cryptonight_ctx) * (threadId + 1)]);
|
||||
cryptonight_ctx* ctx = reinterpret_cast<cryptonight_ctx*>(&m_memory[MEMORY - sizeof(cryptonight_ctx) *
|
||||
(threadId + 1)]);
|
||||
|
||||
const int ratio = m_doubleHash ? 2 : 1;
|
||||
ctx->memory = &m_memory[MEMORY * (threadId * ratio + 1)];
|
||||
const int ratio = m_doubleHash ? 2 : 1;
|
||||
ctx->memory = &m_memory[MEMORY * (threadId * ratio + 1)];
|
||||
|
||||
return ctx;
|
||||
return ctx;
|
||||
}
|
||||
|
||||
|
||||
|
||||
void *Mem::calloc(size_t num, size_t size)
|
||||
void* Mem::calloc(size_t num, size_t size)
|
||||
{
|
||||
void *mem = &m_memory[m_offset];
|
||||
m_offset += (num * size);
|
||||
void* mem = &m_memory[m_offset];
|
||||
m_offset += (num * size);
|
||||
|
||||
memset(mem, 0, num * size);
|
||||
memset(mem, 0, num * size);
|
||||
|
||||
return mem;
|
||||
return mem;
|
||||
}
|
||||
|
||||
|
||||
#ifndef XMRIG_NO_AEON
|
||||
cryptonight_ctx *Mem::createLite(int threadId) {
|
||||
cryptonight_ctx *ctx;
|
||||
cryptonight_ctx* Mem::createLite(int threadId)
|
||||
{
|
||||
cryptonight_ctx* ctx;
|
||||
|
||||
if (!m_doubleHash) {
|
||||
const size_t offset = MEMORY * (threadId + 1);
|
||||
if(!m_doubleHash)
|
||||
{
|
||||
const size_t offset = MEMORY * (threadId + 1);
|
||||
|
||||
ctx = reinterpret_cast<cryptonight_ctx *>(&m_memory[offset + MEMORY_LITE]);
|
||||
ctx->memory = &m_memory[offset];
|
||||
return ctx;
|
||||
}
|
||||
ctx = reinterpret_cast<cryptonight_ctx*>(&m_memory[offset + MEMORY_LITE]);
|
||||
ctx->memory = &m_memory[offset];
|
||||
return ctx;
|
||||
}
|
||||
|
||||
ctx = reinterpret_cast<cryptonight_ctx *>(&m_memory[MEMORY - sizeof(cryptonight_ctx) * (threadId + 1)]);
|
||||
ctx->memory = &m_memory[MEMORY * (threadId + 1)];
|
||||
ctx = reinterpret_cast<cryptonight_ctx*>(&m_memory[MEMORY - sizeof(cryptonight_ctx) * (threadId + 1)]);
|
||||
ctx->memory = &m_memory[MEMORY * (threadId + 1)];
|
||||
|
||||
return ctx;
|
||||
return ctx;
|
||||
}
|
||||
#endif
|
||||
|
|
|
@ -91,10 +91,17 @@ const uint8_t saes_sbox[256] = saes_data(saes_h0);
|
|||
|
||||
static inline __m128i soft_aesenc(__m128i in, __m128i key)
|
||||
{
|
||||
#if defined(_MSC_VER)
|
||||
const uint32_t x0 = in.m128i_u32[0];
|
||||
const uint32_t x1 = in.m128i_u32[1];
|
||||
const uint32_t x2 = in.m128i_u32[2];
|
||||
const uint32_t x3 = in.m128i_u32[3];
|
||||
#else
|
||||
const uint32_t x0 = _mm_cvtsi128_si32(in);
|
||||
const uint32_t x1 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0x55));
|
||||
const uint32_t x2 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0xAA));
|
||||
const uint32_t x3 = _mm_cvtsi128_si32(_mm_shuffle_epi32(in, 0xFF));
|
||||
#endif
|
||||
|
||||
__m128i out = _mm_set_epi32(
|
||||
(saes_table[0][x3 & 0xff] ^ saes_table[1][(x0 >> 8) & 0xff] ^ saes_table[2][(x1 >> 16) & 0xff] ^
|
||||
|
|
|
@ -32,9 +32,9 @@ class JobResult;
|
|||
class IJobResultListener
|
||||
{
|
||||
public:
|
||||
virtual ~IJobResultListener() {}
|
||||
virtual ~IJobResultListener() {}
|
||||
|
||||
virtual void onJobResult(const JobResult &result) = 0;
|
||||
virtual void onJobResult(const JobResult & result) = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -31,11 +31,11 @@
|
|||
class IWorker
|
||||
{
|
||||
public:
|
||||
virtual ~IWorker() {}
|
||||
virtual ~IWorker() {}
|
||||
|
||||
virtual uint64_t hashCount() const = 0;
|
||||
virtual uint64_t timestamp() const = 0;
|
||||
virtual void start() = 0;
|
||||
virtual uint64_t hashCount() const = 0;
|
||||
virtual uint64_t timestamp() const = 0;
|
||||
virtual void start() = 0;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -35,46 +35,47 @@
|
|||
class JobResult
|
||||
{
|
||||
public:
|
||||
inline JobResult() : poolId(0), diff(0), nonce(0) {}
|
||||
inline JobResult(int poolId, const JobId &jobId, uint32_t nonce, const uint8_t *result, uint32_t diff) :
|
||||
poolId(poolId),
|
||||
jobId(jobId),
|
||||
diff(diff),
|
||||
nonce(nonce)
|
||||
{
|
||||
memcpy(this->result, result, sizeof(this->result));
|
||||
}
|
||||
inline JobResult() : poolId(0), diff(0), nonce(0) {}
|
||||
inline JobResult(int poolId, const JobId & jobId, uint32_t nonce, const uint8_t* result, uint32_t diff) :
|
||||
poolId(poolId),
|
||||
jobId(jobId),
|
||||
diff(diff),
|
||||
nonce(nonce)
|
||||
{
|
||||
memcpy(this->result, result, sizeof(this->result));
|
||||
}
|
||||
|
||||
|
||||
inline JobResult(const Job &job) : poolId(0), diff(0), nonce(0)
|
||||
{
|
||||
jobId = job.id();
|
||||
poolId = job.poolId();
|
||||
diff = job.diff();
|
||||
nonce = *job.nonce();
|
||||
}
|
||||
inline JobResult(const Job & job) : poolId(0), diff(0), nonce(0)
|
||||
{
|
||||
jobId = job.id();
|
||||
poolId = job.poolId();
|
||||
diff = job.diff();
|
||||
nonce = *job.nonce();
|
||||
}
|
||||
|
||||
|
||||
inline JobResult &operator=(const Job &job) {
|
||||
jobId = job.id();
|
||||
poolId = job.poolId();
|
||||
diff = job.diff();
|
||||
inline JobResult & operator=(const Job & job)
|
||||
{
|
||||
jobId = job.id();
|
||||
poolId = job.poolId();
|
||||
diff = job.diff();
|
||||
|
||||
return *this;
|
||||
}
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
inline uint64_t actualDiff() const
|
||||
{
|
||||
return Job::toDiff(reinterpret_cast<const uint64_t*>(result)[3]);
|
||||
}
|
||||
inline uint64_t actualDiff() const
|
||||
{
|
||||
return Job::toDiff(reinterpret_cast<const uint64_t*>(result)[3]);
|
||||
}
|
||||
|
||||
|
||||
int poolId;
|
||||
JobId jobId;
|
||||
uint32_t diff;
|
||||
uint32_t nonce;
|
||||
uint8_t result[32];
|
||||
int poolId;
|
||||
JobId jobId;
|
||||
uint32_t diff;
|
||||
uint32_t nonce;
|
||||
uint8_t result[32];
|
||||
};
|
||||
|
||||
#endif /* __JOBRESULT_H__ */
|
||||
|
|
|
@ -31,18 +31,18 @@
|
|||
class SubmitResult
|
||||
{
|
||||
public:
|
||||
inline SubmitResult() : seq(0), diff(0), actualDiff(0), elapsed(0), start(0) {}
|
||||
SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff);
|
||||
inline SubmitResult() : seq(0), diff(0), actualDiff(0), elapsed(0), start(0) {}
|
||||
SubmitResult(int64_t seq, uint32_t diff, uint64_t actualDiff);
|
||||
|
||||
void done();
|
||||
void done();
|
||||
|
||||
int64_t seq;
|
||||
uint32_t diff;
|
||||
uint64_t actualDiff;
|
||||
uint64_t elapsed;
|
||||
int64_t seq;
|
||||
uint32_t diff;
|
||||
uint64_t actualDiff;
|
||||
uint64_t elapsed;
|
||||
|
||||
private:
|
||||
uint64_t start;
|
||||
uint64_t start;
|
||||
};
|
||||
|
||||
#endif /* __SUBMITRESULT_H__ */
|
||||
|
|
|
@ -37,21 +37,21 @@ class Handle;
|
|||
class DoubleWorker : public Worker
|
||||
{
|
||||
public:
|
||||
DoubleWorker(Handle *handle);
|
||||
~DoubleWorker();
|
||||
DoubleWorker(Handle* handle);
|
||||
~DoubleWorker();
|
||||
|
||||
void start() override;
|
||||
void start() override;
|
||||
|
||||
private:
|
||||
bool resume(const Job &job);
|
||||
void consumeJob();
|
||||
void save(const Job &job);
|
||||
bool resume(const Job & job);
|
||||
void consumeJob();
|
||||
void save(const Job & job);
|
||||
|
||||
class State;
|
||||
class State;
|
||||
|
||||
uint8_t m_hash[64];
|
||||
State *m_state;
|
||||
State *m_pausedState;
|
||||
uint8_t m_hash[64];
|
||||
State* m_state;
|
||||
State* m_pausedState;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -35,24 +35,42 @@ class IWorker;
|
|||
class Handle
|
||||
{
|
||||
public:
|
||||
Handle(int threadId, int threads, int64_t affinity, int priority);
|
||||
void join();
|
||||
void start(void (*callback) (void *));
|
||||
Handle(int threadId, int threads, int64_t affinity, int priority);
|
||||
void join();
|
||||
void start(void (*callback)(void*));
|
||||
|
||||
inline int priority() const { return m_priority; }
|
||||
inline int threadId() const { return m_threadId; }
|
||||
inline int threads() const { return m_threads; }
|
||||
inline int64_t affinity() const { return m_affinity; }
|
||||
inline IWorker *worker() const { return m_worker; }
|
||||
inline void setWorker(IWorker *worker) { m_worker = worker; }
|
||||
inline int priority() const
|
||||
{
|
||||
return m_priority;
|
||||
}
|
||||
inline int threadId() const
|
||||
{
|
||||
return m_threadId;
|
||||
}
|
||||
inline int threads() const
|
||||
{
|
||||
return m_threads;
|
||||
}
|
||||
inline int64_t affinity() const
|
||||
{
|
||||
return m_affinity;
|
||||
}
|
||||
inline IWorker* worker() const
|
||||
{
|
||||
return m_worker;
|
||||
}
|
||||
inline void setWorker(IWorker* worker)
|
||||
{
|
||||
m_worker = worker;
|
||||
}
|
||||
|
||||
private:
|
||||
int m_priority;
|
||||
int m_threadId;
|
||||
int m_threads;
|
||||
int64_t m_affinity;
|
||||
IWorker *m_worker;
|
||||
uv_thread_t m_thread;
|
||||
int m_priority;
|
||||
int m_threadId;
|
||||
int m_threads;
|
||||
int64_t m_affinity;
|
||||
IWorker* m_worker;
|
||||
uv_thread_t m_thread;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -36,18 +36,18 @@ class Handle;
|
|||
class SingleWorker : public Worker
|
||||
{
|
||||
public:
|
||||
SingleWorker(Handle *handle);
|
||||
SingleWorker(Handle* handle);
|
||||
|
||||
void start() override;
|
||||
void start() override;
|
||||
|
||||
private:
|
||||
bool resume(const Job &job);
|
||||
void consumeJob();
|
||||
void save(const Job &job);
|
||||
bool resume(const Job & job);
|
||||
void consumeJob();
|
||||
void save(const Job & job);
|
||||
|
||||
Job m_job;
|
||||
Job m_paused;
|
||||
JobResult m_result;
|
||||
Job m_job;
|
||||
Job m_paused;
|
||||
JobResult m_result;
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -308,8 +308,8 @@
|
|||
<GenerateMapFile>true</GenerateMapFile>
|
||||
<AssemblyDebug>true</AssemblyDebug>
|
||||
<ProgramDatabaseFile>$(ProjectName)$(Platform)d.pdb</ProgramDatabaseFile>
|
||||
<LinkStatus>true</LinkStatus>
|
||||
<MapExports>true</MapExports>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='vc-release|x64'">
|
||||
|
@ -328,7 +328,7 @@
|
|||
<AdditionalLibraryDirectories>$(SolutionDir)\..\..\libuv-1.x\Release\$(Platform)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libuv.lib;advapi32.lib;iphlpapi.lib;psapi.lib;shell32.lib;user32.lib;userenv.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCMTD;LIBCMT</IgnoreSpecificDefaultLibraries>
|
||||
<LinkStatus>true</LinkStatus>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='vc-debug|Win32'">
|
||||
|
@ -342,12 +342,12 @@
|
|||
<AdditionalLibraryDirectories>$(SolutionDir)\..\..\libuv-1.x\Release\$(Platform)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCMTD;LIBCMT</IgnoreSpecificDefaultLibraries>
|
||||
<AdditionalDependencies>libuv.lib;advapi32.lib;iphlpapi.lib;psapi.lib;shell32.lib;user32.lib;userenv.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<LinkStatus>true</LinkStatus>
|
||||
<ProgramDatabaseFile>$(ProjectName)$(Platform)d.pdb</ProgramDatabaseFile>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
<GenerateMapFile>true</GenerateMapFile>
|
||||
<MapExports>true</MapExports>
|
||||
<AssemblyDebug>true</AssemblyDebug>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='vc-release|Win32'">
|
||||
|
@ -367,7 +367,7 @@
|
|||
<AdditionalLibraryDirectories>$(SolutionDir)\..\..\libuv-1.x\Release\$(Platform)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
|
||||
<AdditionalDependencies>libuv.lib;advapi32.lib;iphlpapi.lib;psapi.lib;shell32.lib;user32.lib;userenv.lib;ws2_32.lib;%(AdditionalDependencies)</AdditionalDependencies>
|
||||
<IgnoreSpecificDefaultLibraries>LIBCMTD;LIBCMT</IgnoreSpecificDefaultLibraries>
|
||||
<LinkStatus>true</LinkStatus>
|
||||
<LinkTimeCodeGeneration>UseLinkTimeCodeGeneration</LinkTimeCodeGeneration>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
|
|
|
@ -519,24 +519,6 @@
|
|||
<ClInclude Include="..\src\net\strategies\SinglePoolStrategy.h">
|
||||
<Filter>Archivos de encabezado\net\strategies</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\DoubleWorker.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Handle.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Hashrate.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\SingleWorker.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Worker.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Workers.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\3rdparty\libcpuid\amd_code_t.h">
|
||||
<Filter>Archivos de encabezado\3rdparty\libcpuid</Filter>
|
||||
</ClInclude>
|
||||
|
@ -570,6 +552,24 @@
|
|||
<ClInclude Include="..\src\3rdparty\libcpuid\recog_amd.h">
|
||||
<Filter>Archivos de encabezado\3rdparty\libcpuid</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Workers.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\DoubleWorker.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Handle.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Hashrate.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\SingleWorker.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="..\src\workers\Worker.h">
|
||||
<Filter>Archivos de encabezado\workers</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<MASM Include="..\src\3rdparty\libcpuid\masm-x64.asm">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue