{
cl_program program = NULL;
cl_int err = CL_SUCCESS;
+ cl_uint i;
CHECK_CONTEXT (context);
+ INVALID_VALUE_IF (count == 0);
+ INVALID_VALUE_IF (strings == NULL);
+ for(i = 0; i < count; i++) {
+ if(UNLIKELY(strings[i] == NULL)) {
+ err = CL_INVALID_VALUE;
+ goto error;
+ }
+ }
program = cl_program_create_from_source(context,
count,
strings,
/* Everything is easy. We only support one device anyway */
if (num_devices != 0) {
assert(program->ctx);
- if (UNLIKELY(device_list[0] != program->ctx->device)) {
- err = CL_INVALID_DEVICE;
- goto error;
- }
+ INVALID_DEVICE_IF (device_list[0] != program->ctx->device);
}
/* TODO support create program from binary */
err = CL_INVALID_PROGRAM_EXECUTABLE;
goto error;
}
+ INVALID_VALUE_IF (kernel_name == NULL);
kernel = cl_program_create_kernel(program, kernel_name, &err);
error:
cl_uint i;
assert(ctx);
- INVALID_VALUE_IF (count == 0);
- INVALID_VALUE_IF (strings == NULL);
// the real compilation step will be done at build time since we do not have
// yet the compilation options
cl_int err = CL_SUCCESS;
uint32_t i = 0;
- if (UNLIKELY(name == NULL)) {
- err = CL_INVALID_KERNEL_NAME;
- goto error;
- }
-
/* Find the program first */
for (i = 0; i < p->ker_n; ++i) {
assert(p->ker[i]);