summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuo <xionghu.luo@intel.com>2014-06-13 08:58:17 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-06-13 13:50:46 +0800
commitc45f5b9fdb184c411224cb9bbb886146d11f061e (patch)
tree635f509963b5764ea625cbbcc701fad1a338f95e
parent04c2a7f6271948832b49dd02eeb5cae6b2a2bb6e (diff)
add[opencl-1.2] test case for API clCreateProgramWithBuiltInKernels.
Tested-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r--utests/CMakeLists.txt1
-rw-r--r--utests/enqueue_built_in_kernels.cpp20
2 files changed, 21 insertions, 0 deletions
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index 67200a78..bb1b2dcb 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -174,6 +174,7 @@ set (utests_sources
enqueue_copy_buf_unaligned.cpp
test_printf.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 00000000..8b47bca4
--- /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);