[Beignet] [PATCH] utest: Add test case for build-in function get_work_dim.

Yi Sun yi.sun at intel.com
Sun May 26 08:24:27 PDT 2013


We're starting to implement the test cases for each build-in fucntions, of course, occording to OpenCL 1.0 specification.

Now this case is only for compiling since function get_work_dim is just in the TO-DO list. We can enhance test case when the function is implemented.

Signed-off-by: Yi Sun <yi.sun at intel.com>

diff --git a/kernels/buildin_work_dim.cl b/kernels/buildin_work_dim.cl
new file mode 100644
index 0000000..67bc2e7
--- /dev/null
+++ b/kernels/buildin_work_dim.cl
@@ -0,0 +1,3 @@
+kernel void buildin_work_dim() {
+  int i = get_work_dim();
+}
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt
index 63c873d..5775357 100644
--- a/utests/CMakeLists.txt
+++ b/utests/CMakeLists.txt
@@ -76,6 +76,7 @@ set (utests_sources
   compiler_volatile.cpp
   compiler_copy_image1.cpp
   compiler_get_image_info.cpp
+  buildin_work_dim.cpp
   runtime_createcontext.cpp
   utest_assert.cpp
   utest.cpp
diff --git a/utests/buildin_work_dim.cpp b/utests/buildin_work_dim.cpp
new file mode 100644
index 0000000..730be86
--- /dev/null
+++ b/utests/buildin_work_dim.cpp
@@ -0,0 +1,13 @@
+#include "utest_helper.hpp"
+
+static void buildin_work_dim(void)
+{
+  // Setup kernel and buffers
+  OCL_CREATE_KERNEL("buildin_work_dim");
+
+  OCL_NDRANGE(1);
+
+}
+
+MAKE_UTEST_FROM_FUNCTION(buildin_work_dim);
+
-- 
1.7.6.4



More information about the Beignet mailing list