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

Weng, Chuanbo chuanbo.weng at intel.com
Mon Oct 10 06:36:54 UTC 2016


Hi Rebecca,
	Please see my comments below.

-----Original Message-----
From: Beignet [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Rebecca N. Palmer
Sent: Saturday, October 8, 2016 9:27 PM
To: beignet at lists.freedesktop.org
Subject: [Beignet] [PATCH] Utests: Allow testing cl_intel_accelerator via ICD

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)
[**** 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()) 
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 at lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list