Features of 1.6.5 (#140)
* Hashrate improve -> add autodetection mode for cpu-affinity * Hashrate improve, more stable hashrates -> refactor memory allocation * Add TubeV4 support (cn-heavy + ipbc mod + soft-aes mod) * Update ccp-httpd lib to fix stop/freeze of cc communication on some miners * Fix cn-heavy on arm processors
This commit is contained in:
parent
7897f8f645
commit
90699d58ec
38 changed files with 5525 additions and 3114 deletions
25
src/Cpu.cpp
25
src/Cpu.cpp
|
@ -145,9 +145,9 @@ void Cpu::optimizeParameters(size_t& threadsCount, size_t& hashFactor, Options::
|
|||
CpuImpl::instance().optimizeParameters(threadsCount, hashFactor, algo, maxCpuUsage, safeMode);
|
||||
}
|
||||
|
||||
void Cpu::setAffinity(int id, uint64_t mask)
|
||||
int Cpu::setThreadAffinity(size_t threadId, int64_t affinityMask)
|
||||
{
|
||||
CpuImpl::instance().setAffinity(id, mask);
|
||||
return CpuImpl::instance().setThreadAffinity(threadId, affinityMask);
|
||||
}
|
||||
|
||||
bool Cpu::hasAES()
|
||||
|
@ -194,3 +194,24 @@ size_t Cpu::availableCache()
|
|||
{
|
||||
return CpuImpl::instance().availableCache();
|
||||
}
|
||||
|
||||
int Cpu::getAssignedCpuId(size_t threadId, int64_t affinityMask)
|
||||
{
|
||||
int cpuId = -1;
|
||||
|
||||
Mem::ThreadBitSet threadAffinityMask = Mem::ThreadBitSet(affinityMask);
|
||||
size_t threadCount = 0;
|
||||
|
||||
for (size_t i = 0; i < CpuImpl::instance().threads(); i++) {
|
||||
if (threadAffinityMask.test(i)) {
|
||||
if (threadCount == threadId) {
|
||||
cpuId = i;
|
||||
break;
|
||||
}
|
||||
|
||||
threadCount++;
|
||||
}
|
||||
}
|
||||
|
||||
return cpuId;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue