Added platform option.

This commit is contained in:
XMRig 2019-08-19 22:35:58 +07:00
parent 476e5dcb18
commit 166a68244e
9 changed files with 194 additions and 26 deletions

View file

@ -23,11 +23,9 @@
*/
#include <stdio.h>
#include "backend/opencl/wrappers/OclLib.h"
#include "backend/opencl/wrappers/OclPlatform.h"
#include "rapidjson/document.h"
std::vector<xmrig::OclPlatform> xmrig::OclPlatform::get()
@ -65,6 +63,27 @@ void xmrig::OclPlatform::print()
}
rapidjson::Value xmrig::OclPlatform::toJSON(rapidjson::Document &doc) const
{
using namespace rapidjson;
auto &allocator = doc.GetAllocator();
if (!isValid()) {
return Value(kNullType);
}
Value out(kObjectType);
out.AddMember("index", index(), allocator);
out.AddMember("profile", profile().toJSON(doc), allocator);
out.AddMember("version", version().toJSON(doc), allocator);
out.AddMember("name", name().toJSON(doc), allocator);
out.AddMember("vendor", vendor().toJSON(doc), allocator);
out.AddMember("extensions", extensions().toJSON(doc), allocator);
return out;
}
xmrig::String xmrig::OclPlatform::extensions() const
{
return OclLib::getPlatformInfo(id(), CL_PLATFORM_EXTENSIONS);