Insert ocl_common_defines to the cl source file.
authorZhigang Gong <zhigang.gong@linux.intel.com>
Sat, 29 Dec 2012 12:42:07 +0000 (20:42 +0800)
committerZhigang Gong <zhigang.gong@linux.intel.com>
Wed, 10 Apr 2013 06:51:31 +0000 (14:51 +0800)
Remove the duplicate definitions in the ocl_stdlib.h. As we
may need to refer these two macros, we put it to the ocl_common_defins.h
which could be included by host application.
The two macros are as below:

Signed-off-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Reviewed-by: Lu Guanqun <guanqun.lu@intel.com>
backend/src/backend/program.cpp
backend/src/ocl_stdlib.h

index 0378de7..3597a0a 100644 (file)
@@ -98,6 +98,7 @@ namespace gbe {
   }
 
   extern std::string ocl_stdlib_str;
+  extern std::string ocl_common_defines_str;
   static gbe_program programNewFromSource(const char *source,
                                           size_t stringSize,
                                           const char *options,
@@ -111,6 +112,7 @@ namespace gbe {
     // Write the source to the cl file
     FILE *clFile = fopen(clName.c_str(), "w");
     FATAL_IF(clFile == NULL, "Failed to open temporary file");
+    fwrite(ocl_common_defines_str.c_str(), strlen(ocl_common_defines_str.c_str()), 1, clFile);
     fwrite(ocl_stdlib_str.c_str(), strlen(ocl_stdlib_str.c_str()), 1, clFile);
     fwrite(source, strlen(source), 1, clFile);
     fclose(clFile);
index 32ed118..ea63830 100644 (file)
@@ -615,10 +615,6 @@ DECL_VECTOR_1OP(__gen_ocl_internal_log, float);
 DECL_VECTOR_1OP(__gen_ocl_internal_log2, float);
 DECL_VECTOR_1OP(__gen_ocl_internal_log10, float);
 #undef DECL_VECTOR_1OP
-// Synchronization, explicit memory fence
-/////////////////////////////////////////////////////////////////////////////
-#define CLK_LOCAL_MEM_FENCE 1
-#define CLK_GLOBAL_MEM_FENCE 2
 /////////////////////////////////////////////////////////////////////////////
 // Arithmetic functions
 /////////////////////////////////////////////////////////////////////////////