[Beignet] [PATCH 3/3] [opencl-1.2] add test case for API clCreateProgramWithBuiltInKernels.

xionghu.luo at intel.com xionghu.luo at intel.com
Wed May 7 21:48:50 PDT 2014


From: Luo <xionghu.luo at intel.com>

---
 utests/CMakeLists.txt               |  1 +
 utests/enqueue_built_in_kernels.cpp | 20 ++++++++++++++++++++
 2 files changed, 21 insertions(+)
 create mode 100644 utests/enqueue_built_in_kernels.cpp

diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index 415dcb6..90585d9 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -176,6 +176,7 @@ set (utests_sources
   enqueue_copy_buf.cpp
   enqueue_copy_buf_unaligned.cpp
   enqueue_fill_buf.cpp
+  enqueue_built_in_kernels.cpp
   utest_assert.cpp
   utest.cpp
   utest_file_map.cpp
diff --git a/utests/enqueue_built_in_kernels.cpp b/utests/enqueue_built_in_kernels.cpp
new file mode 100644
index 0000000..8b47bca
--- /dev/null
+++ b/utests/enqueue_built_in_kernels.cpp
@@ -0,0 +1,20 @@
+#include "utest_helper.hpp"
+
+void enqueue_built_in_kernels(void)
+{
+  char* built_in_kernel_names;
+  size_t built_in_kernels_size;
+  cl_int err = CL_SUCCESS;
+  size_t ret_sz;
+
+
+  OCL_CALL (clGetDeviceInfo, device, CL_DEVICE_BUILT_IN_KERNELS, 0, 0, &built_in_kernels_size);
+  built_in_kernel_names = (char* )malloc(built_in_kernels_size * sizeof(char) );
+  OCL_CALL(clGetDeviceInfo, device, CL_DEVICE_BUILT_IN_KERNELS, built_in_kernels_size, (void*)built_in_kernel_names, &ret_sz);
+  OCL_ASSERT(ret_sz == built_in_kernels_size);
+  cl_program built_in_prog = clCreateProgramWithBuiltInKernels(ctx, 1, &device, built_in_kernel_names, &err);
+  OCL_ASSERT(built_in_prog != NULL);
+
+}
+
+MAKE_UTEST_FROM_FUNCTION(enqueue_built_in_kernels);
-- 
1.8.1.2



More information about the Beignet mailing list