New style function selector.
This commit is contained in:
parent
72cd6d168e
commit
903b243308
12 changed files with 287 additions and 31 deletions
|
@ -29,6 +29,9 @@
|
|||
#include "xmrig.h"
|
||||
|
||||
|
||||
struct cryptonight_ctx;
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
|
@ -46,17 +49,21 @@ public:
|
|||
CpuThread(size_t index, Algo algorithm, AlgoVariant av, Multiway multiway, int64_t affinity, int priority, bool softAES, bool prefetch);
|
||||
~CpuThread();
|
||||
|
||||
typedef void (*cn_hash_fun)(const uint8_t *input, size_t size, uint8_t *output, cryptonight_ctx *ctx);
|
||||
|
||||
static cn_hash_fun fn(Algo algorithm, AlgoVariant av, Variant variant);
|
||||
static CpuThread *createFromAV(size_t index, Algo algorithm, AlgoVariant av, int64_t affinity, int priority);
|
||||
|
||||
inline bool isPrefetch() const { return m_prefetch; }
|
||||
inline bool isSoftAES() const { return m_softAES; }
|
||||
inline bool isPrefetch() const { return m_prefetch; }
|
||||
inline bool isSoftAES() const { return m_softAES; }
|
||||
inline cn_hash_fun fn(Variant variant) const { return fn(m_algorithm, m_av, variant); }
|
||||
|
||||
inline Algo algorithm() const override { return m_algorithm; }
|
||||
inline int multiway() const override { return m_multiway; }
|
||||
inline int priority() const override { return m_priority; }
|
||||
inline int64_t affinity() const override { return m_affinity; }
|
||||
inline size_t index() const override { return m_index; }
|
||||
inline Type type() const override { return CPU; }
|
||||
inline Algo algorithm() const override { return m_algorithm; }
|
||||
inline int multiway() const override { return m_multiway; }
|
||||
inline int priority() const override { return m_priority; }
|
||||
inline int64_t affinity() const override { return m_affinity; }
|
||||
inline size_t index() const override { return m_index; }
|
||||
inline Type type() const override { return CPU; }
|
||||
|
||||
# ifndef XMRIG_NO_API
|
||||
rapidjson::Value toAPI(rapidjson::Document &doc) const override;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue