Implemented CUDA config generation.
This commit is contained in:
parent
77d5b73724
commit
d4a3024996
16 changed files with 208 additions and 42 deletions
|
@ -26,14 +26,13 @@
|
|||
#define XMRIG_CUDATHREAD_H
|
||||
|
||||
|
||||
using nvid_ctx = struct nvid_ctx;
|
||||
|
||||
|
||||
#include "crypto/common/Algorithm.h"
|
||||
#include "rapidjson/fwd.h"
|
||||
|
||||
|
||||
#include <bitset>
|
||||
#include <vector>
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
|
||||
|
||||
|
@ -41,10 +40,16 @@ class CudaThread
|
|||
{
|
||||
public:
|
||||
CudaThread() = delete;
|
||||
|
||||
CudaThread(const rapidjson::Value &value);
|
||||
CudaThread(uint32_t index, nvid_ctx *ctx);
|
||||
|
||||
inline bool isValid() const { return false; }
|
||||
inline bool isValid() const { return m_blocks > 0 && m_threads > 0; }
|
||||
inline int32_t bfactor() const { return static_cast<int32_t>(m_bfactor); }
|
||||
inline int32_t blocks() const { return m_blocks; }
|
||||
inline int32_t bsleep() const { return static_cast<int32_t>(m_bsleep); }
|
||||
inline int32_t threads() const { return m_threads; }
|
||||
inline int64_t affinity() const { return m_affinity; }
|
||||
inline uint32_t index() const { return m_index; }
|
||||
|
||||
inline bool operator!=(const CudaThread &other) const { return !isEqual(other); }
|
||||
inline bool operator==(const CudaThread &other) const { return isEqual(other); }
|
||||
|
@ -53,6 +58,18 @@ public:
|
|||
rapidjson::Value toJSON(rapidjson::Document &doc) const;
|
||||
|
||||
private:
|
||||
int32_t m_blocks = 0;
|
||||
int32_t m_threads = 0;
|
||||
int64_t m_affinity = -1;
|
||||
uint32_t m_index = 0;
|
||||
|
||||
# ifdef _WIN32
|
||||
uint32_t m_bfactor = 6;
|
||||
uint32_t m_bsleep = 25;
|
||||
# else
|
||||
uint32_t m_bfactor = 0;
|
||||
uint32_t m_bsleep = 0;
|
||||
# endif
|
||||
};
|
||||
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue