Better cl_context wrapping.

This commit is contained in:
XMRig 2019-09-01 07:37:02 +07:00
parent b541960611
commit 10d2c0285c
7 changed files with 23 additions and 8 deletions

View file

@ -27,6 +27,13 @@
#include "backend/opencl/wrappers/OclContext.h"
xmrig::OclContext::OclContext(const OclDevice &device)
{
std::vector<cl_device_id> ids = { device.id() };
m_ctx = OclLib::createContext(ids);
}
xmrig::OclContext::~OclContext()
{
if (m_ctx) {

View file

@ -40,6 +40,7 @@ class OclContext
{
public:
OclContext() = default;
OclContext(const OclDevice &device);
~OclContext();
bool init(const std::vector<OclDevice> &devices, std::vector<OclLaunchData> &threads);