[Beignet] [PATCH 4/4] Per openCL spec, set p->is_built to 1 when build fail.
Yang Rong
rong.r.yang at intel.com
Mon Oct 28 07:02:18 CET 2013
Also correct the err code when build fail.
Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
src/cl_api.c | 4 ++--
src/cl_program.c | 6 +++---
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/cl_api.c b/src/cl_api.c
index 37a7545..2aca3f8 100644
--- a/src/cl_api.c
+++ b/src/cl_api.c
@@ -961,7 +961,7 @@ clCreateKernel(cl_program program,
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;
}
@@ -983,7 +983,7 @@ clCreateKernelsInProgram(cl_program program,
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;
}
diff --git a/src/cl_program.c b/src/cl_program.c
index ad6e098..e7d67de 100644
--- a/src/cl_program.c
+++ b/src/cl_program.c
@@ -326,7 +326,7 @@ cl_program_build(cl_program p, const char *options)
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;
}
@@ -336,7 +336,7 @@ cl_program_build(cl_program p, const char *options)
} 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;
}
@@ -359,8 +359,8 @@ cl_program_build(cl_program p, const char *options)
copyed += sz;
}
- p->is_built = 1;
error:
+ p->is_built = 1;
return err;
}
--
1.8.1.2
More information about the Beignet
mailing list