summaryrefslogtreecommitdiff
path: root/src/CMakeLists.txt
diff options
context:
space:
mode:
authorLuo <xionghu.luo@intel.com>2014-05-12 12:56:26 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-05-22 18:07:54 +0800
commit4a3e69d6df6141777dd67e97aff2a451bc01aa00 (patch)
tree8de3ee4380cab942ad24ad1e23fef6d9012a8c10 /src/CMakeLists.txt
parentdacaf74130c60502481f896f1a86e6c622d1f128 (diff)
move enqueue_copy_image kernels outside of runtime code.
seperate the kernel code from host code to make it clean; build the kernels offline by gbe_bin_generator to improve the performance. v2: fix the image base issue with the standalone compiler. Reviewed-by: "Yang, Rong R" <rong.r.yang@intel.com> Signed-off-by: Zhigang Gong <zhigang.gong@intel.com>
Diffstat (limited to 'src/CMakeLists.txt')
-rw-r--r--src/CMakeLists.txt23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index f93ddcd5..20e1a4c6 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -23,11 +23,30 @@ foreach (KF ${KERNEL_FILES})
endforeach (KF)
endmacro (MakeKernelBinStr)
+macro (MakeBuiltInKernelStr KERNEL_PATH KERNEL_FILES)
+ set (output_file ${KERNEL_PATH}/${BUILT_IN_NAME}.cl)
+ set (file_content)
+ file (REMOVE ${output_file})
+ foreach (KF ${KERNEL_NAMES})
+ set (input_file ${KERNEL_PATH}/${KF}.cl)
+ file(READ ${input_file} file_content )
+ STRING(REGEX REPLACE ";" "\\\\;" file_content "${file_content}")
+ file(APPEND ${output_file} ${file_content})
+ endforeach (KF)
+endmacro (MakeBuiltInKernelStr)
+
set (KERNEL_STR_FILES)
-set (KERNEL_NAMES cl_internal_copy_buf_align1 cl_internal_copy_buf_align4
+set (KERNEL_NAMES cl_internal_copy_buf_align4
cl_internal_copy_buf_align16 cl_internal_copy_buf_unalign_same_offset
-cl_internal_copy_buf_unalign_dst_offset cl_internal_copy_buf_unalign_src_offset)
+cl_internal_copy_buf_unalign_dst_offset cl_internal_copy_buf_unalign_src_offset
+cl_internal_copy_buf_rect cl_internal_copy_image_2d_to_2d cl_internal_copy_image_3d_to_2d
+cl_internal_copy_image_2d_to_3d cl_internal_copy_image_3d_to_3d
+cl_internal_copy_image_2d_to_buffer cl_internal_copy_image_3d_to_buffer
+cl_internal_copy_buffer_to_image_2d cl_internal_copy_buffer_to_image_3d)
+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}")
set(OPENCL_SRC
${KERNEL_STR_FILES}