diff options
author | Junyan He <junyan.he@linux.intel.com> | 2016-01-28 12:20:06 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2016-04-22 17:24:17 +0800 |
commit | 2d79819d40490c840d8b078100ae98510e3bc4f9 (patch) | |
tree | 3f56a9c85a9ae2943fe6ab9b4139c1c75966d6be /utests/test_printf.cpp | |
parent | 391fb2715263faeb30354927bc006e0e8c4d3607 (diff) | |
download | beignet-2d79819d40490c840d8b078100ae98510e3bc4f9.tar.gz |
Add several printf utest cases.
Signed-off-by: Junyan He <junyan.he@linux.intel.com>
Reviewed-by: Yan Wang <yan.wang@linux.intel.com>
Reviewed-by: Junyan He <junyan.he@linux.intel.com>
Diffstat (limited to 'utests/test_printf.cpp')
-rw-r--r-- | utests/test_printf.cpp | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/utests/test_printf.cpp b/utests/test_printf.cpp index 36015745..84c3fae3 100644 --- a/utests/test_printf.cpp +++ b/utests/test_printf.cpp @@ -16,3 +16,57 @@ void test_printf(void) } MAKE_UTEST_FROM_FUNCTION(test_printf); + +void test_printf_1(void) +{ + // Setup kernel and buffers + OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_1"); + globals[0] = 1; + locals[0] = 1; + + // Run the kernel on GPU + OCL_NDRANGE(1); +} + +MAKE_UTEST_FROM_FUNCTION(test_printf_1); + +void test_printf_2(void) +{ + // Setup kernel and buffers + OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_2"); + globals[0] = 4; + locals[0] = 2; + + // Run the kernel on GPU + OCL_NDRANGE(1); +} + +MAKE_UTEST_FROM_FUNCTION(test_printf_2); + +void test_printf_3(void) +{ + char c = '@'; + // Setup kernel and buffers + OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_3"); + globals[0] = 1; + locals[0] = 1; + OCL_SET_ARG(0, sizeof(char), &c); + + // Run the kernel on GPU + OCL_NDRANGE(1); +} + +MAKE_UTEST_FROM_FUNCTION(test_printf_3); + +void test_printf_4(void) +{ + // Setup kernel and buffers + OCL_CREATE_KERNEL_FROM_FILE("test_printf", "test_printf_4"); + globals[0] = 1; + locals[0] = 1; + + // Run the kernel on GPU + OCL_NDRANGE(1); +} + +MAKE_UTEST_FROM_FUNCTION(test_printf_4); |