Utests: Allow testing cl_intel_accelerator via ICD

Submitted by Chuanbo Weng on Oct. 10, 2016, 6:36 a.m.

Details

Message ID 5A0E318D73C83C40A09BDBBE131796D738CA4BC2@shsmsx102.ccr.corp.intel.com
State New
Headers show
Series "Utests: Allow testing cl_intel_accelerator via ICD" ( rev: 2 ) in Beignet

Not browsing as part of any series.

Commit Message

Chuanbo Weng Oct. 10, 2016, 6:36 a.m.
Hi Rebecca,
	Please see my comments below.

-----Original Message-----
From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of Rebecca N. Palmer

Sent: Saturday, October 8, 2016 9:27 PM
To: beignet@lists.freedesktop.org
Subject: [Beignet] [PATCH] Utests: Allow testing cl_intel_accelerator via ICD

Signed-off-by: Rebecca N. Palmer <rebecca_palmer@zoho.com>

---
 utests/CMakeLists.txt                                 | 4 ++--
 utests/builtin_kernel_block_motion_estimate_intel.cpp | 4 ++++
 2 files changed, 6 insertions(+), 2 deletions(-)

The implementation of cl_check_accelerator and cl_check_motion_estimation are similar as cl_check_subgroups.

   char* built_in_kernel_names;
   size_t built_in_kernels_size;
   cl_int err = CL_SUCCESS;
--
2.1.4


_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet

Patch hide | download patch | download mbox

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)
[**** Chuanbo ****] I agree to add builtin_kernel_block_motion_estimate_intel to default utest.
 
 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;
+  }
[**** Chuanbo ****] This utest test intel extension cl_intel_accelerator and cl_intel_motion_estimation, so it's not beignet specific,
but it's intel specific. You can add code such as:
	if (!cl_check_accelerator() && !cl_check_motion_estimation())