break;
case CL_CONTEXT_NUM_DEVICES:
- buf.as_scalar<cl_uint>() = ctx.devs().size();
+ buf.as_scalar<cl_uint>() = ctx.devices().size();
break;
case CL_CONTEXT_DEVICES:
- buf.as_vector<cl_device_id>() = descs(ctx.devs());
+ buf.as_vector<cl_device_id>() = descs(ctx.devices());
break;
case CL_CONTEXT_PROPERTIES:
- buf.as_vector<cl_context_properties>() = desc(ctx.props());
+ buf.as_vector<cl_context_properties>() = desc(ctx.properties());
break;
default:
if (!size ||
size > fold(maximum(), cl_ulong(0),
- map(std::mem_fn(&device::max_mem_alloc_size), ctx.devs())
+ map(std::mem_fn(&device::max_mem_alloc_size), ctx.devices())
))
throw error(CL_INVALID_BUFFER_SIZE);
throw error(CL_INVALID_VALUE);
if (any_of([&](const device &dev) {
- return !count(dev, ctx.devs());
+ return !count(dev, ctx.devices());
}, devs))
throw error(CL_INVALID_DEVICE);
void *user_data) try {
auto &prog = obj(d_prog);
auto devs = (d_devs ? objs(d_devs, num_devs) :
- ref_vector<device>(prog.context().devs()));
+ ref_vector<device>(prog.context().devices()));
auto opts = (p_opts ? p_opts : "");
if (bool(num_devs) != bool(d_devs) ||
throw error(CL_INVALID_VALUE);
if (any_of([&](const device &dev) {
- return !count(dev, prog.context().devs());
+ return !count(dev, prog.context().devices());
}, devs))
throw error(CL_INVALID_DEVICE);
case CL_PROGRAM_NUM_DEVICES:
buf.as_scalar<cl_uint>() = (prog.devices().size() ?
prog.devices().size() :
- prog.context().devs().size());
+ prog.context().devices().size());
break;
case CL_PROGRAM_DEVICES:
buf.as_vector<cl_device_id>() = (prog.devices().size() ?
descs(prog.devices()) :
- descs(prog.context().devs()));
+ descs(prog.context().devices()));
break;
case CL_PROGRAM_SOURCE:
auto &prog = obj(d_prog);
auto &dev = obj(d_dev);
- if (!count(dev, prog.context().devs()))
+ if (!count(dev, prog.context().devices()))
return CL_INVALID_DEVICE;
switch (param) {
auto &ctx = obj(d_ctx);
auto &dev = obj(d_dev);
- if (!count(dev, ctx.devs()))
+ if (!count(dev, ctx.devices()))
throw error(CL_INVALID_DEVICE);
if (props & ~(CL_QUEUE_OUT_OF_ORDER_EXEC_MODE_ENABLE |
break;
case CL_QUEUE_PROPERTIES:
- buf.as_scalar<cl_command_queue_properties>() = q.props();
+ buf.as_scalar<cl_command_queue_properties>() = q.properties();
break;
default:
context::context(const property_list &props,
const ref_vector<device> &devs) :
- _props(props), _devs(devs) {
+ props(props), devs(devs) {
}
bool
}
const context::property_list &
-context::props() const {
- return _props;
+context::properties() const {
+ return props;
}
context::device_range
-context::devs() const {
- return map(evals(), _devs);
+context::devices() const {
+ return map(evals(), devs);
}
operator!=(const context &ctx) const;
const property_list &
- props() const;
+ properties() const;
device_range
- devs() const;
+ devices() const;
private:
- property_list _props;
- const std::vector<intrusive_ref<device>> _devs;
+ property_list props;
+ const std::vector<intrusive_ref<device>> devs;
};
}
if (all_of([=](const device &dev) {
return dev.pipe->is_format_supported(
dev.pipe, f.second, target, 1, bindings);
- }, ctx.devs()))
+ }, ctx.devices()))
s.insert(f.first);
}
command_queue::command_queue(clover::context &ctx, clover::device &dev,
cl_command_queue_properties props) :
- context(ctx), device(dev), _props(props) {
+ context(ctx), device(dev), props(props) {
pipe = dev.pipe->context_create(dev.pipe, NULL);
if (!pipe)
throw error(CL_INVALID_DEVICE);
}
cl_command_queue_properties
-command_queue::props() const {
- return _props;
+command_queue::properties() const {
+ return props;
}
bool
command_queue::profiling_enabled() const {
- return _props & CL_QUEUE_PROFILING_ENABLE;
+ return props & CL_QUEUE_PROFILING_ENABLE;
}
void
void flush();
- cl_command_queue_properties props() const;
+ cl_command_queue_properties properties() const;
bool profiling_enabled() const;
const intrusive_ref<clover::context> context;
/// and push it to the pending list.
void sequence(hard_event &ev);
- cl_command_queue_properties _props;
+ cl_command_queue_properties props;
pipe_context *pipe;
std::deque<intrusive_ref<hard_event>> queued_events;
};