[Beignet] [PATCH] Refine the build option checking.

Song, Ruiling ruiling.song at intel.com
Tue Oct 29 07:02:27 CET 2013


Looks good.

-----Original Message-----
From: beignet-bounces+ruiling.song=intel.com at lists.freedesktop.org [mailto:beignet-bounces+ruiling.song=intel.com at lists.freedesktop.org] On Behalf Of Yang Rong
Sent: Tuesday, October 29, 2013 2:00 PM
To: beignet at lists.freedesktop.org
Cc: Yang, Rong R
Subject: [Beignet] [PATCH] Refine the build option checking.


Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 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
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list