void *host_ptr, cl_int *r_errcode) try {
auto &ctx = obj(d_ctx);
+ if (!any_of(std::mem_fn(&device::image_support), ctx.devices()))
+ throw error(CL_INVALID_OPERATION);
+
if (flags & ~(CL_MEM_READ_WRITE | CL_MEM_WRITE_ONLY | CL_MEM_READ_ONLY |
CL_MEM_USE_HOST_PTR | CL_MEM_ALLOC_HOST_PTR |
CL_MEM_COPY_HOST_PTR))
void *host_ptr, cl_int *r_errcode) try {
auto &ctx = obj(d_ctx);
+ if (!any_of(std::mem_fn(&device::image_support), ctx.devices()))
+ throw error(CL_INVALID_OPERATION);
+
if (flags & ~(CL_MEM_READ_WRITE | CL_MEM_WRITE_ONLY | CL_MEM_READ_ONLY |
CL_MEM_USE_HOST_PTR | CL_MEM_ALLOC_HOST_PTR |
CL_MEM_COPY_HOST_PTR))
cl_int *r_errcode) try {
auto &ctx = obj(d_ctx);
+ if (!any_of(std::mem_fn(&device::image_support), ctx.devices()))
+ throw error(CL_INVALID_OPERATION);
+
ret_error(r_errcode, CL_SUCCESS);
return new sampler(ctx, norm_mode, addr_mode, filter_mode);
const vector_t &orig, const vector_t ®ion) {
vector_t size = { img.width(), img.height(), img.depth() };
+ if (!q.device().image_support())
+ throw error(CL_INVALID_OPERATION);
+
if (img.context() != q.context())
throw error(CL_INVALID_CONTEXT);