mirror of
https://github.com/xmrig/xmrig.git
synced 2025-12-08 08:23:34 -05:00
Implemented NvmlLib.
This commit is contained in:
@@ -30,7 +30,8 @@
|
||||
#include "base/tools/String.h"
|
||||
|
||||
|
||||
using nvid_ctx = struct nvid_ctx;
|
||||
using nvid_ctx = struct nvid_ctx;
|
||||
using nvmlDevice_t = struct nvmlDevice_st *;
|
||||
|
||||
|
||||
namespace xmrig {
|
||||
@@ -57,11 +58,16 @@ public:
|
||||
uint32_t smx() const;
|
||||
void generate(const Algorithm &algorithm, CudaThreads &threads) const;
|
||||
|
||||
inline bool isValid() const { return m_ctx != nullptr; }
|
||||
inline const PciTopology &topology() const { return m_topology; }
|
||||
inline const String &name() const { return m_name; }
|
||||
inline uint32_t arch() const { return (computeCapability(true) * 10) + computeCapability(false); }
|
||||
inline uint32_t index() const { return m_index; }
|
||||
inline bool isValid() const { return m_ctx != nullptr; }
|
||||
inline const PciTopology &topology() const { return m_topology; }
|
||||
inline const String &name() const { return m_name; }
|
||||
inline uint32_t arch() const { return (computeCapability(true) * 10) + computeCapability(false); }
|
||||
inline uint32_t index() const { return m_index; }
|
||||
|
||||
# ifdef XMRIG_FEATURE_NVML
|
||||
inline nvmlDevice_t nvmlDevice() const { return m_nvmlDevice; }
|
||||
inline void setNvmlDevice(nvmlDevice_t device) { m_nvmlDevice = device; }
|
||||
# endif
|
||||
|
||||
# ifdef XMRIG_FEATURE_API
|
||||
void toJSON(rapidjson::Value &out, rapidjson::Document &doc) const;
|
||||
@@ -75,6 +81,10 @@ private:
|
||||
nvid_ctx *m_ctx = nullptr;
|
||||
PciTopology m_topology;
|
||||
String m_name;
|
||||
|
||||
# ifdef XMRIG_FEATURE_NVML
|
||||
nvmlDevice_t m_nvmlDevice = nullptr;
|
||||
# endif
|
||||
};
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user