[Beignet] [PATCH] CMAKE: Refine builtin kernel bin generator
Xiuli Pan
xiuli.pan at intel.com
Thu Feb 23 07:11:48 UTC 2017
From: Pan Xiuli <xiuli.pan at intel.com>
Move the generated builtin str and bin files into the Cmake build
directory to avoid chaos when changing LLVM.
Signed-off-by: Pan Xiuli <xiuli.pan at intel.com>
---
src/CMakeLists.txt | 10 +++++-----
1 file changed, 5 insertions(+), 5 deletions(-)
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f3c4632..0482327 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -9,7 +9,7 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
macro (MakeKernelBinStr KERNEL_PATH KERNEL_FILES)
foreach (KF ${KERNEL_FILES})
- set (input_file ${KERNEL_PATH}/${KF}.cl)
+ set (input_file ${CMAKE_CURRENT_SOURCE_DIR}/kernels/${KF}.cl)
set (output_file ${KERNEL_PATH}/${KF}_str.c)
list (APPEND KERNEL_STR_FILES ${output_file})
list (GET GBE_BIN_GENERATER -1 GBE_BIN_FILE)
@@ -34,7 +34,7 @@ macro (MakeBuiltInKernelStr KERNEL_PATH KERNEL_FILES)
set (file_content)
file (REMOVE ${output_file})
foreach (KF ${KERNEL_NAMES})
- set (input_file ${KERNEL_PATH}/${KF}.cl)
+ set (input_file ${CMAKE_CURRENT_SOURCE_DIR}/kernels/${KF}.cl)
file(READ ${input_file} file_content )
STRING(REGEX REPLACE ";" "\\\\;" file_content "${file_content}")
file(APPEND ${output_file} ${file_content})
@@ -60,9 +60,9 @@ cl_internal_fill_image_1d_array cl_internal_fill_image_2d
cl_internal_fill_image_2d_array cl_internal_fill_image_3d
cl_internal_block_motion_estimate_intel)
set (BUILT_IN_NAME cl_internal_built_in_kernel)
-MakeBuiltInKernelStr ("${CMAKE_CURRENT_SOURCE_DIR}/kernels/" "${KERNEL_NAMES}")
-MakeKernelBinStr ("${CMAKE_CURRENT_SOURCE_DIR}/kernels/" "${KERNEL_NAMES}")
-MakeKernelBinStr ("${CMAKE_CURRENT_SOURCE_DIR}/kernels/" "${BUILT_IN_NAME}")
+MakeBuiltInKernelStr ("${CMAKE_CURRENT_BINARY_DIR}/kernels/" "${KERNEL_NAMES}")
+MakeKernelBinStr ("${CMAKE_CURRENT_BINARY_DIR}/kernels/" "${KERNEL_NAMES}")
+MakeKernelBinStr ("${CMAKE_CURRENT_BINARY_DIR}/kernels/" "${BUILT_IN_NAME}")
set(OPENCL_SRC
${KERNEL_STR_FILES}
--
2.7.4
More information about the Beignet
mailing list