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
47
src/Mem.h
47
src/Mem.h
|
@ -33,22 +33,47 @@
|
|||
|
||||
#include "Options.h"
|
||||
|
||||
struct cryptonight_ctx;
|
||||
#ifdef _WIN32
|
||||
# ifdef __GNUC__
|
||||
# include <mm_malloc.h>
|
||||
# else
|
||||
# include <malloc.h>
|
||||
# endif
|
||||
#else
|
||||
# if defined(XMRIG_ARM) && !defined(__clang__)
|
||||
# include "aligned_malloc.h"
|
||||
# else
|
||||
# include <mm_malloc.h>
|
||||
# endif
|
||||
#endif
|
||||
|
||||
struct ScratchPad;
|
||||
|
||||
struct ScratchPadMem
|
||||
{
|
||||
alignas(16) uint8_t *memory;
|
||||
|
||||
size_t hugePages;
|
||||
size_t pages;
|
||||
size_t size;
|
||||
size_t realSize;
|
||||
};
|
||||
|
||||
|
||||
class Mem
|
||||
{
|
||||
public:
|
||||
typedef std::bitset<128> ThreadBitSet;
|
||||
|
||||
enum Flags {
|
||||
HugepagesAvailable = 1,
|
||||
HugepagesEnabled = 2,
|
||||
Lock = 4
|
||||
};
|
||||
|
||||
static bool allocate(const Options* options);
|
||||
static cryptonight_ctx *create(int threadId);
|
||||
static void release();
|
||||
static void init(const Options* option);
|
||||
static ScratchPadMem create(ScratchPad** scratchPads, int threadId);
|
||||
static void release(ScratchPad** scratchPads, ScratchPadMem& scratchPadMem, int threadId);
|
||||
|
||||
static inline size_t hashFactor() { return m_hashFactor; }
|
||||
static inline size_t getThreadHashFactor(int threadId)
|
||||
|
@ -56,19 +81,19 @@ public:
|
|||
return (m_multiHashThreadMask.all() ||
|
||||
m_multiHashThreadMask.test(threadId)) ? m_hashFactor : 1;
|
||||
}
|
||||
|
||||
static inline bool isHugepagesAvailable() { return (m_flags & HugepagesAvailable) != 0; }
|
||||
static inline bool isHugepagesEnabled() { return (m_flags & HugepagesEnabled) != 0; }
|
||||
static inline int flags() { return m_flags; }
|
||||
static inline size_t threads() { return m_threads; }
|
||||
|
||||
private:
|
||||
static void allocate(ScratchPadMem& scratchPadMem, bool useHugePages);
|
||||
static void release(ScratchPadMem& scratchPadMem);
|
||||
|
||||
private:
|
||||
static bool m_useHugePages;
|
||||
static size_t m_hashFactor;
|
||||
static size_t m_threads;
|
||||
static int m_algo;
|
||||
static int m_flags;
|
||||
static Options::Algo m_algo;
|
||||
static ThreadBitSet m_multiHashThreadMask;
|
||||
static size_t m_memorySize;
|
||||
alignas(16) static uint8_t *m_memory;
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue