void
kernel::scalar_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_ARG_VALUE);
+
if (size != this->size)
throw error(CL_INVALID_ARG_SIZE);
if (value)
throw error(CL_INVALID_ARG_VALUE);
+ if (!size)
+ throw error(CL_INVALID_ARG_SIZE);
+
_storage = size;
_set = true;
}
void
kernel::image_rd_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_ARG_VALUE);
+
if (size != sizeof(cl_mem))
throw error(CL_INVALID_ARG_SIZE);
void
kernel::image_wr_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_ARG_VALUE);
+
if (size != sizeof(cl_mem))
throw error(CL_INVALID_ARG_SIZE);
void
kernel::sampler_argument::set(size_t size, const void *value) {
+ if (!value)
+ throw error(CL_INVALID_SAMPLER);
+
if (size != sizeof(cl_sampler))
throw error(CL_INVALID_ARG_SIZE);