[Beignet] [PATCH] Utests: Allow testing cl_intel_accelerator via ICD

Rebecca N. Palmer rebecca_palmer at zoho.com
Sat Oct 8 13:27:29 UTC 2016


Signed-off-by: Rebecca N. Palmer <rebecca_palmer at zoho.com>
---
 utests/CMakeLists.txt                                 | 4 ++--
 utests/builtin_kernel_block_motion_estimate_intel.cpp | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index f94256c..a5d8d40 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -287,7 +287,8 @@ set (utests_sources
   multi_queue_events.cpp
   compiler_mix.cpp
   compiler_math_3op.cpp
-  compiler_bsort.cpp)
+  compiler_bsort.cpp
+  builtin_kernel_block_motion_estimate_intel.cpp)
 
 if (LLVM_VERSION_NODOT VERSION_GREATER 34)
   SET(utests_sources
@@ -328,7 +329,6 @@ else(GEN_PCI_ID)
 endif(GEN_PCI_ID)
 
 if (NOT_BUILD_STAND_ALONE_UTEST)
-  SET(utests_sources ${utests_sources} builtin_kernel_block_motion_estimate_intel.cpp)
   ADD_CUSTOM_TARGET(kernel_bin.bin DEPENDS ${kernel_bin}.bin)
 endif (NOT_BUILD_STAND_ALONE_UTEST)
 
diff --git a/utests/builtin_kernel_block_motion_estimate_intel.cpp b/utests/builtin_kernel_block_motion_estimate_intel.cpp
index 15bf761..a0f8302 100644
--- a/utests/builtin_kernel_block_motion_estimate_intel.cpp
+++ b/utests/builtin_kernel_block_motion_estimate_intel.cpp
@@ -8,6 +8,10 @@ OCLRELEASEACCELERATORINTEL * oclReleaseAcceleratorIntel = NULL;
 
 void builtin_kernel_block_motion_estimate_intel(void)
 {
+  if (!cl_check_beignet()) {
+    printf("Not beignet device , Skip!");
+    return;
+  }
   char* built_in_kernel_names;
   size_t built_in_kernels_size;
   cl_int err = CL_SUCCESS;
-- 
2.1.4




More information about the Beignet mailing list