Added CUDA threads to API.

This commit is contained in:
XMRig 2019-10-28 13:18:00 +07:00
parent 99fe304c1f
commit 8cd265c38c
4 changed files with 35 additions and 3 deletions

View file

@ -115,5 +115,15 @@ void xmrig::CudaDevice::generate(const Algorithm &algorithm, CudaThreads &thread
#ifdef XMRIG_FEATURE_API
void xmrig::CudaDevice::toJSON(rapidjson::Value &out, rapidjson::Document &doc) const
{
using namespace rapidjson;
auto &allocator = doc.GetAllocator();
out.AddMember("name", name().toJSON(doc), allocator);
out.AddMember("bus_id", topology().toString().toJSON(doc), allocator);
out.AddMember("smx", smx(), allocator);
out.AddMember("arch", arch(), allocator);
out.AddMember("global_mem", static_cast<uint64_t>(globalMemSize()), allocator);
out.AddMember("clock", clock(), allocator);
out.AddMember("memory_clock", memoryClock(), allocator);
}
#endif

View file

@ -60,6 +60,7 @@ public:
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_API