[Beignet] [PATCH] Disable optimize when compiler libocl.

Yang Rong rong.r.yang at intel.com
Sun Nov 9 21:17:09 PST 2014


The GBE would inline and optimize the function in the libocl again, so use -O0
when compilering libocl.

Signed-off-by: Yang Rong <rong.r.yang at intel.com>
---
 backend/src/libocl/CMakeLists.txt | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/backend/src/libocl/CMakeLists.txt b/backend/src/libocl/CMakeLists.txt
index b0074b3..3718da3 100644
--- a/backend/src/libocl/CMakeLists.txt
+++ b/backend/src/libocl/CMakeLists.txt
@@ -136,7 +136,7 @@ MACRO(ADD_CL_TO_BC_TARGET _file)
     ADD_CUSTOM_COMMAND(OUTPUT ${output_name}
 	COMMAND mkdir -p ${LIBOCL_BINARY_DIR}/lib/
 	#COMMAND echo ${LLVM_INSTALL_DIR}clang -cc1 ${CLANG_OCL_FLAGS} -I ${LIBOCL_BINARY_DIR}/include/ -emit-llvm-bc -triple spir -o ${output_name} -x cl ${_file}
-	COMMAND ${LLVM_INSTALL_DIR}clang -cc1 ${CLANG_OCL_FLAGS} -I ${LIBOCL_BINARY_DIR}/include/ -emit-llvm-bc -triple spir -o ${output_name} -x cl ${_file}
+	COMMAND ${LLVM_INSTALL_DIR}clang -cc1 ${CLANG_OCL_FLAGS} -O0 -I ${LIBOCL_BINARY_DIR}/include/ -emit-llvm-bc -triple spir -o ${output_name} -x cl ${_file}
 	DEPENDS ${_file} ${OCL_HEADER_FILES}
 	COMMENT "Compiling ${_file}"
 	)
-- 
1.9.1



More information about the Beignet mailing list