summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/api
diff options
context:
space:
mode:
Diffstat (limited to 'src/gallium/state_trackers/clover/api')
-rw-r--r--src/gallium/state_trackers/clover/api/event.cpp12
-rw-r--r--src/gallium/state_trackers/clover/api/kernel.cpp20
-rw-r--r--src/gallium/state_trackers/clover/api/memory.cpp4
-rw-r--r--src/gallium/state_trackers/clover/api/program.cpp20
-rw-r--r--src/gallium/state_trackers/clover/api/queue.cpp4
-rw-r--r--src/gallium/state_trackers/clover/api/sampler.cpp2
-rw-r--r--src/gallium/state_trackers/clover/api/transfer.cpp8
7 files changed, 35 insertions, 35 deletions
diff --git a/src/gallium/state_trackers/clover/api/event.cpp b/src/gallium/state_trackers/clover/api/event.cpp
index 05534c74c99..7057b77db1e 100644
--- a/src/gallium/state_trackers/clover/api/event.cpp
+++ b/src/gallium/state_trackers/clover/api/event.cpp
@@ -63,7 +63,7 @@ clWaitForEvents(cl_uint num_evs, const cl_event *d_evs) try {
auto evs = objs(d_evs, num_evs);
for (auto &ev : evs) {
- if (ev.ctx != evs.front().ctx)
+ if (ev.context() != evs.front().context())
throw error(CL_INVALID_CONTEXT);
if (ev.status() < 0)
@@ -73,7 +73,7 @@ clWaitForEvents(cl_uint num_evs, const cl_event *d_evs) try {
// Create a temporary soft event that depends on all the events in
// the wait list
intrusive_ptr<soft_event> sev =
- transfer(new soft_event(evs.front().ctx, evs, true));
+ transfer(new soft_event(evs.front().context(), evs, true));
// ...and wait on it.
sev->wait();
@@ -96,7 +96,7 @@ clGetEventInfo(cl_event d_ev, cl_event_info param,
break;
case CL_EVENT_CONTEXT:
- buf.as_scalar<cl_context>() = desc(ev.ctx);
+ buf.as_scalar<cl_context>() = desc(ev.context());
break;
case CL_EVENT_COMMAND_TYPE:
@@ -133,7 +133,7 @@ clSetEventCallback(cl_event d_ev, cl_int type,
// Create a temporary soft event that depends on ev, with
// pfn_notify as completion action.
intrusive_ptr<soft_event> sev = transfer(
- new soft_event(ev.ctx, { ev }, true,
+ new soft_event(ev.context(), { ev }, true,
[=, &ev](event &) {
ev.wait();
pfn_notify(desc(ev), ev.status(), user_data);
@@ -199,8 +199,8 @@ clEnqueueWaitForEvents(cl_command_queue d_q, cl_uint num_evs,
auto evs = objs(d_evs, num_evs);
for (auto &ev : evs) {
- if (ev.ctx != q.ctx)
- throw error(CL_INVALID_CONTEXT);
+ if (ev.context() != q.context())
+ throw error(CL_INVALID_CONTEXT);
}
// Create a hard event that depends on the events in the wait list:
diff --git a/src/gallium/state_trackers/clover/api/kernel.cpp b/src/gallium/state_trackers/clover/api/kernel.cpp
index 33673633c6d..f1a9bd84d34 100644
--- a/src/gallium/state_trackers/clover/api/kernel.cpp
+++ b/src/gallium/state_trackers/clover/api/kernel.cpp
@@ -125,11 +125,11 @@ clGetKernelInfo(cl_kernel d_kern, cl_kernel_info param,
break;
case CL_KERNEL_CONTEXT:
- buf.as_scalar<cl_context>() = desc(kern.prog.ctx);
+ buf.as_scalar<cl_context>() = desc(kern.program().context());
break;
case CL_KERNEL_PROGRAM:
- buf.as_scalar<cl_program>() = desc(kern.prog);
+ buf.as_scalar<cl_program>() = desc(kern.program());
break;
default:
@@ -148,9 +148,9 @@ clGetKernelWorkGroupInfo(cl_kernel d_kern, cl_device_id d_dev,
size_t size, void *r_buf, size_t *r_size) try {
property_buffer buf { r_buf, size, r_size };
auto &kern = obj(d_kern);
- auto &dev = (d_dev ? *pobj(d_dev) : unique(kern.prog.devices()));
+ auto &dev = (d_dev ? *pobj(d_dev) : unique(kern.program().devices()));
- if (!count(dev, kern.prog.devices()))
+ if (!count(dev, kern.program().devices()))
throw error(CL_INVALID_DEVICE);
switch (param) {
@@ -194,9 +194,9 @@ namespace {
void
validate_common(const command_queue &q, kernel &kern,
const ref_vector<event> &deps) {
- if (kern.prog.ctx != q.ctx ||
+ if (kern.program().context() != q.context() ||
any_of([&](const event &ev) {
- return ev.ctx != q.ctx;
+ return ev.context() != q.context();
}, deps))
throw error(CL_INVALID_CONTEXT);
@@ -205,7 +205,7 @@ namespace {
}, kern.args()))
throw error(CL_INVALID_KERNEL_ARGS);
- if (!count(q.dev, kern.prog.devices()))
+ if (!count(q.device(), kern.program().devices()))
throw error(CL_INVALID_PROGRAM_EXECUTABLE);
}
@@ -214,7 +214,7 @@ namespace {
const size_t *d_grid_size) {
auto grid_size = range(d_grid_size, dims);
- if (dims < 1 || dims > q.dev.max_block_size().size())
+ if (dims < 1 || dims > q.device().max_block_size().size())
throw error(CL_INVALID_WORK_DIMENSION);
if (!d_grid_size || any_of(is_zero(), grid_size))
@@ -242,14 +242,14 @@ namespace {
auto block_size = range(d_block_size, dims);
if (any_of(is_zero(), block_size) ||
- any_of(greater(), block_size, q.dev.max_block_size()))
+ any_of(greater(), block_size, q.device().max_block_size()))
throw error(CL_INVALID_WORK_ITEM_SIZE);
if (any_of(modulus(), grid_size, block_size))
throw error(CL_INVALID_WORK_GROUP_SIZE);
if (fold(multiplies(), 1u, block_size) >
- q.dev.max_threads_per_block())
+ q.device().max_threads_per_block())
throw error(CL_INVALID_WORK_GROUP_SIZE);
return block_size;
diff --git a/src/gallium/state_trackers/clover/api/memory.cpp b/src/gallium/state_trackers/clover/api/memory.cpp
index e51a7291732..84b3bcb4c09 100644
--- a/src/gallium/state_trackers/clover/api/memory.cpp
+++ b/src/gallium/state_trackers/clover/api/memory.cpp
@@ -230,12 +230,12 @@ clGetMemObjectInfo(cl_mem d_mem, cl_mem_info param,
break;
case CL_MEM_CONTEXT:
- buf.as_scalar<cl_context>() = desc(mem.ctx);
+ buf.as_scalar<cl_context>() = desc(mem.context());
break;
case CL_MEM_ASSOCIATED_MEMOBJECT: {
sub_buffer *sub = dynamic_cast<sub_buffer *>(&mem);
- buf.as_scalar<cl_mem>() = (sub ? desc(sub->parent) : NULL);
+ buf.as_scalar<cl_mem>() = (sub ? desc(sub->parent()) : NULL);
break;
}
case CL_MEM_OFFSET: {
diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
index 6049209b6a0..8867ee97c58 100644
--- a/src/gallium/state_trackers/clover/api/program.cpp
+++ b/src/gallium/state_trackers/clover/api/program.cpp
@@ -133,7 +133,7 @@ clBuildProgram(cl_program d_prog, cl_uint num_devs,
void *user_data) try {
auto &prog = obj(d_prog);
auto devs = (d_devs ? objs(d_devs, num_devs) :
- ref_vector<device>(prog.ctx.devs()));
+ ref_vector<device>(prog.context().devs()));
auto opts = (p_opts ? p_opts : "");
if (bool(num_devs) != bool(d_devs) ||
@@ -141,7 +141,7 @@ clBuildProgram(cl_program d_prog, cl_uint num_devs,
throw error(CL_INVALID_VALUE);
if (any_of([&](const device &dev) {
- return !count(dev, prog.ctx.devs());
+ return !count(dev, prog.context().devs());
}, devs))
throw error(CL_INVALID_DEVICE);
@@ -169,19 +169,19 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param,
break;
case CL_PROGRAM_CONTEXT:
- buf.as_scalar<cl_context>() = desc(prog.ctx);
+ buf.as_scalar<cl_context>() = desc(prog.context());
break;
case CL_PROGRAM_NUM_DEVICES:
- buf.as_scalar<cl_uint>() = prog.devices().size() ?
- prog.devices().size() :
- prog.ctx.devs().size();
+ buf.as_scalar<cl_uint>() = (prog.devices().size() ?
+ prog.devices().size() :
+ prog.context().devs().size());
break;
case CL_PROGRAM_DEVICES:
- buf.as_vector<cl_device_id>() = prog.devices().size() ?
- descs(prog.devices()) :
- descs(prog.ctx.devs());
+ buf.as_vector<cl_device_id>() = (prog.devices().size() ?
+ descs(prog.devices()) :
+ descs(prog.context().devs()));
break;
case CL_PROGRAM_SOURCE:
@@ -226,7 +226,7 @@ clGetProgramBuildInfo(cl_program d_prog, cl_device_id d_dev,
auto &prog = obj(d_prog);
auto &dev = obj(d_dev);
- if (!count(dev, prog.ctx.devs()))
+ if (!count(dev, prog.context().devs()))
return CL_INVALID_DEVICE;
switch (param) {
diff --git a/src/gallium/state_trackers/clover/api/queue.cpp b/src/gallium/state_trackers/clover/api/queue.cpp
index 1c251b01589..8498e977b9c 100644
--- a/src/gallium/state_trackers/clover/api/queue.cpp
+++ b/src/gallium/state_trackers/clover/api/queue.cpp
@@ -75,11 +75,11 @@ clGetCommandQueueInfo(cl_command_queue d_q, cl_command_queue_info param,
switch (param) {
case CL_QUEUE_CONTEXT:
- buf.as_scalar<cl_context>() = desc(q.ctx);
+ buf.as_scalar<cl_context>() = desc(q.context());
break;
case CL_QUEUE_DEVICE:
- buf.as_scalar<cl_device_id>() = desc(q.dev);
+ buf.as_scalar<cl_device_id>() = desc(q.device());
break;
case CL_QUEUE_REFERENCE_COUNT:
diff --git a/src/gallium/state_trackers/clover/api/sampler.cpp b/src/gallium/state_trackers/clover/api/sampler.cpp
index 5a04d2b745d..403892b2e60 100644
--- a/src/gallium/state_trackers/clover/api/sampler.cpp
+++ b/src/gallium/state_trackers/clover/api/sampler.cpp
@@ -71,7 +71,7 @@ clGetSamplerInfo(cl_sampler d_s, cl_sampler_info param,
break;
case CL_SAMPLER_CONTEXT:
- buf.as_scalar<cl_context>() = desc(s.ctx);
+ buf.as_scalar<cl_context>() = desc(s.context());
break;
case CL_SAMPLER_NORMALIZED_COORDS:
diff --git a/src/gallium/state_trackers/clover/api/transfer.cpp b/src/gallium/state_trackers/clover/api/transfer.cpp
index 48717be0c36..02d0dd0a71d 100644
--- a/src/gallium/state_trackers/clover/api/transfer.cpp
+++ b/src/gallium/state_trackers/clover/api/transfer.cpp
@@ -24,7 +24,7 @@
#include "api/util.hpp"
#include "core/event.hpp"
-#include "core/resource.hpp"
+#include "core/memory.hpp"
using namespace clover;
@@ -56,7 +56,7 @@ namespace {
validate_common(command_queue &q,
const ref_vector<event> &deps) {
if (any_of([&](const event &ev) {
- return &ev.ctx != &q.ctx;
+ return ev.context() != q.context();
}, deps))
throw error(CL_INVALID_CONTEXT);
}
@@ -67,7 +67,7 @@ namespace {
void
validate_object(command_queue &q, buffer &mem, const vector_t &origin,
const vector_t &pitch, const vector_t &region) {
- if (mem.ctx != q.ctx)
+ if (mem.context() != q.context())
throw error(CL_INVALID_CONTEXT);
// The region must fit within the specified pitch,
@@ -90,7 +90,7 @@ namespace {
const vector_t &orig, const vector_t &region) {
vector_t size = { img.width(), img.height(), img.depth() };
- if (img.ctx != q.ctx)
+ if (img.context() != q.context())
throw error(CL_INVALID_CONTEXT);
if (any_of(greater(), orig + region, size))