summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuo Yejun <yejun.guo@intel.com>2015-01-09 14:43:37 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-01-12 09:05:28 +0800
commitd4c644ce6533a027e96f15b5172cdf44c166c7f9 (patch)
tree6f25bd13c8375770118ad98dc218026d7e0238e7
parentf9a012929bf1f5b6249482ff169f6e86647f1364 (diff)
only build tests that do not need compiler when standalone compiler is provided
the built test case is load_program_from_bin_file, it demos how to generate from source kernel compiler_ceil.cl to binary kernel compiler_ceil.bin with the standalone compiler for a specific gen pci id, and also demos how to load and execute the binary kernel when the compiler is not available in the running system. btw, please make sure compiler_ceil.bin is really updated if there is already one there, the safe way is to delete it first. Signed-off-by: Guo Yejun <yejun.guo@intel.com> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--CMakeLists.txt4
-rw-r--r--utests/CMakeLists.txt28
2 files changed, 23 insertions, 9 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index f929fbcb..38343c18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -187,7 +187,11 @@ ADD_SUBDIRECTORY(include)
ADD_SUBDIRECTORY(backend)
ADD_SUBDIRECTORY(src)
ADD_SUBDIRECTORY(utests)
+
+# compile benchmark only if standalone compiler is not provided
+IF (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true"))
ADD_SUBDIRECTORY(benchmark)
+ENDIF (NOT (USE_STANDALONE_GBE_COMPILER STREQUAL "true"))
SET(CPACK_PACKAGE_VERSION_MAJOR "${LIBCL_DRIVER_VERSION_MAJOR}")
SET(CPACK_PACKAGE_VERSION_MINOR "${LIBCL_DRIVER_VERSION_MINOR}")
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index 9623dc15..a349e593 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -18,8 +18,18 @@ configure_file (
#XXX only need GL if required
link_directories (${LLVM_LIBRARY_DIR} ${OPENGL_LIBDIR} ${DRM_LIBDIR})
-set (utests_sources
+
+set (utests_basic_sources
utest_error.c
+ utest_assert.cpp
+ utest.cpp
+ utest_file_map.cpp
+ utest_helper.cpp)
+
+# the test case with binary kernel
+set (utests_binary_kernel_sources load_program_from_bin_file.cpp enqueue_built_in_kernels.cpp)
+
+set (utests_sources
compiler_basic_arithmetic.cpp
compiler_displacement_map_element.cpp
compiler_mandelbrot.cpp
@@ -178,7 +188,6 @@ set (utests_sources
compiler_simd_all.cpp
compiler_time_stamp.cpp
compiler_double_precision.cpp
- load_program_from_bin_file.cpp
load_program_from_gen_bin.cpp
get_arg_info.cpp
profiling_exec.cpp
@@ -186,7 +195,6 @@ set (utests_sources
enqueue_copy_buf_unaligned.cpp
test_printf.cpp
enqueue_fill_buf.cpp
- enqueue_built_in_kernels.cpp
builtin_kernel_max_global_size.cpp
image_1D_buffer.cpp
compare_image_2d_and_1d_array.cpp
@@ -196,11 +204,7 @@ set (utests_sources
compiler_assignment_operation_in_if.cpp
vload_bench.cpp
runtime_use_host_ptr_buffer.cpp
- runtime_alloc_host_ptr_buffer.cpp
- utest_assert.cpp
- utest.cpp
- utest_file_map.cpp
- utest_helper.cpp)
+ runtime_alloc_host_ptr_buffer.cpp)
if (LLVM_VERSION_NODOT VERSION_GREATER 34)
SET(utests_sources
@@ -255,11 +259,17 @@ else()
SET(UTESTS_REQUIRED_EGL_LIB "")
endif()
+if (USE_STANDALONE_GBE_COMPILER STREQUAL "true")
+ SET(utests_sources ${utests_basic_sources} ${utests_binary_kernel_sources})
+else ()
+ SET(utests_sources ${utests_basic_sources} ${utests_binary_kernel_sources} ${ADDMATHFUNC} ${utests_sources})
+endif ()
+
if (COMPILER STREQUAL "CLANG")
SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wno-tautological-compare")
endif ()
-ADD_LIBRARY(utests SHARED ${ADDMATHFUNC} ${utests_sources})
+ADD_LIBRARY(utests SHARED ${utests_sources})
TARGET_LINK_LIBRARIES(utests cl m ${OPENGL_LIBRARIES} ${UTESTS_REQUIRED_EGL_LIB} ${CMAKE_THREAD_LIBS_INIT} ${UTESTS_REQUIRED_X11_LIB})