summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@linux.intel.com>2012-12-29 20:42:07 +0800
committerZhigang Gong <zhigang.gong@linux.intel.com>2013-04-10 14:51:31 +0800
commit31c1c7847314e2bb371dd927bee1f0a49103360c (patch)
tree1a7ae524145aac4bc92cba10110f1b4291a7d199
parentf029d89b1c7ce4c71a418908402440b4963ca52d (diff)
Insert ocl_common_defines to the cl source file.
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>
-rw-r--r--backend/src/backend/program.cpp2
-rw-r--r--backend/src/ocl_stdlib.h4
2 files changed, 2 insertions, 4 deletions
diff --git a/backend/src/backend/program.cpp b/backend/src/backend/program.cpp
index 0378de79..3597a0aa 100644
--- a/backend/src/backend/program.cpp
+++ b/backend/src/backend/program.cpp
@@ -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);
diff --git a/backend/src/ocl_stdlib.h b/backend/src/ocl_stdlib.h
index 32ed118b..ea638308 100644
--- a/backend/src/ocl_stdlib.h
+++ b/backend/src/ocl_stdlib.h
@@ -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
/////////////////////////////////////////////////////////////////////////////