summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPan Xiuli <xiuli.pan@intel.com>2017-03-02 11:33:31 +0800
committerYang Rong <rong.r.yang@intel.com>2017-03-07 18:16:28 +0800
commit42154657d2c87ec79bf4da472572f296c9fd2fd6 (patch)
treeac2656010a965cff1d893c1da4ccd303cc9641be /src
parent033464f4b8045a49dbcc1a84cde5c05986ca11c2 (diff)
downloadbeignet-42154657d2c87ec79bf4da472572f296c9fd2fd6.tar.gz
CMAKE: Refine builtin kernel bin generator
Move the generated builtin str and bin files into the Cmake build directory to avoid chaos when changing LLVM. V2: Fix a bug that the builtin.cl was not written into build dir. Signed-off-by: Pan Xiuli <xiuli.pan@intel.com> Reviewed-by: Yang Rong <rong.r.yang@intel.com>
Diffstat (limited to 'src')
-rw-r--r--src/CMakeLists.txt14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f3c46328..77a1c871 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -7,10 +7,10 @@ include_directories(${CMAKE_CURRENT_SOURCE_DIR}
${OPENGL_INCLUDE_DIRS}
${EGL_INCLUDE_DIRS})
-macro (MakeKernelBinStr KERNEL_PATH KERNEL_FILES)
+macro (MakeKernelBinStr KERNEL_DIST KERNEL_SOURCE KERNEL_FILES)
foreach (KF ${KERNEL_FILES})
- set (input_file ${KERNEL_PATH}/${KF}.cl)
- set (output_file ${KERNEL_PATH}/${KF}_str.c)
+ set (input_file ${KERNEL_SOURCE}/${KF}.cl)
+ set (output_file ${KERNEL_DIST}/${KF}_str.c)
list (APPEND KERNEL_STR_FILES ${output_file})
list (GET GBE_BIN_GENERATER -1 GBE_BIN_FILE)
if(GEN_PCI_ID)
@@ -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/" "${CMAKE_CURRENT_SOURCE_DIR}/kernels/" "${KERNEL_NAMES}")
+MakeKernelBinStr ("${CMAKE_CURRENT_BINARY_DIR}/kernels/" "${CMAKE_CURRENT_BINARY_DIR}/kernels/" "${BUILT_IN_NAME}")
set(OPENCL_SRC
${KERNEL_STR_FILES}