Looks good. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Yang Rong Sent: Tuesday, October 29, 2013 2:00 PM To: [email protected] Cc: Yang, Rong R Subject: [Beignet] [PATCH] Refine the build option checking.
Signed-off-by: Yang Rong <[email protected]> --- src/cl_program.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/cl_program.c b/src/cl_program.c index e7d67de..b0c29bf 100644 --- a/src/cl_program.c +++ b/src/cl_program.c @@ -301,18 +301,15 @@ cl_program_build(cl_program p, const char *options) int copyed = 0; if (options) { - if(p->build_opts && strcmp(options, p->build_opts) != 0) { - p->source_type = p->source ? FROM_SOURCE : p->binary ? FROM_BINARY : FROM_LLVM; - + if(p->build_opts == NULL || strcmp(options, p->build_opts) != 0) { if(p->build_opts) { cl_free(p->build_opts); p->build_opts = NULL; } - } else if(p->build_opts == NULL) { - p->source_type = p->source ? FROM_SOURCE : p->binary ? FROM_BINARY : FROM_LLVM; - TRY_ALLOC (p->build_opts, cl_calloc(strlen(options) + 1, sizeof(char))); memcpy(p->build_opts, options, strlen(options)); + + p->source_type = p->source ? FROM_SOURCE : p->binary ? + FROM_BINARY : FROM_LLVM; } } -- 1.8.1.2 _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
