cl_int err = CL_SUCCESS;
CHECK_PROGRAM (program);
- if (program->is_built == CL_FALSE) {
+ if (program->ker_n <= 0) {
err = CL_INVALID_PROGRAM_EXECUTABLE;
goto error;
}
cl_int err = CL_SUCCESS;
CHECK_PROGRAM (program);
- if (program->is_built == CL_FALSE) {
+ if (program->ker_n <= 0) {
err = CL_INVALID_PROGRAM_EXECUTABLE;
goto error;
}
if (p->source_type == FROM_SOURCE) {
p->opaque = gbe_program_new_from_source(p->source, 0, options, NULL, NULL);
if (UNLIKELY(p->opaque == NULL)) {
- err = CL_INVALID_PROGRAM;
+ err = CL_BUILD_PROGRAM_FAILURE;
goto error;
}
} else if (p->source_type == FROM_BINARY) {
p->opaque = gbe_program_new_from_binary(p->binary, p->binary_sz);
if (UNLIKELY(p->opaque == NULL)) {
- err = CL_INVALID_PROGRAM;
+ err = CL_BUILD_PROGRAM_FAILURE;
goto error;
}
copyed += sz;
}
- p->is_built = 1;
error:
+ p->is_built = 1;
return err;
}