diff options
author | Lu Guanqun <guanqun.lu@intel.com> | 2012-12-25 13:26:55 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@linux.intel.com> | 2013-03-29 19:35:17 +0800 |
commit | 4d5f9ccae70a540f040bdb4068954f57a3b8ea30 (patch) | |
tree | 170af188adf9d82ace43dc302c456664552bfe0c /utests | |
parent | 18dc79be0c89f4785164c132ae0f31b5e085ac9d (diff) |
fix assertion when two kernels exist in cl file
The root cause is that it fails to increment `currID` when traversing hash map.
Signed-off-by: Lu Guanqun <guanqun.lu@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'utests')
-rw-r--r-- | utests/CMakeLists.txt | 6 | ||||
-rw-r--r-- | utests/compiler_multiple_kernels.cpp | 8 | ||||
-rw-r--r-- | utests/utest_helper.hpp | 5 |
3 files changed, 19 insertions, 0 deletions
diff --git a/utests/CMakeLists.txt b/utests/CMakeLists.txt index 96409cb2..2b52994a 100644 --- a/utests/CMakeLists.txt +++ b/utests/CMakeLists.txt @@ -26,6 +26,12 @@ compiler_shader_toy.cpp compiler_lower_return0.cpp compiler_lower_return1.cpp compiler_lower_return2.cpp + compiler_multiple_kernels.cpp + compiler_obread.cpp + compiler_obwrite.cpp + compiler_region.cpp + compiler_region0.cpp + compiler_region1.cpp compiler_short_scatter.cpp compiler_sub_bytes.cpp compiler_sub_shorts.cpp diff --git a/utests/compiler_multiple_kernels.cpp b/utests/compiler_multiple_kernels.cpp new file mode 100644 index 00000000..09b4349b --- /dev/null +++ b/utests/compiler_multiple_kernels.cpp @@ -0,0 +1,8 @@ +#include "utest_helper.hpp" + +static void compiler_multiple_kernels(void) +{ + OCL_CREATE_KERNEL_FROM_FILE("compiler_multiple_kernels", "first_kernel"); +} + +MAKE_UTEST_FROM_FUNCTION(compiler_multiple_kernels);
\ No newline at end of file diff --git a/utests/utest_helper.hpp b/utests/utest_helper.hpp index 50184334..e1f2395c 100644 --- a/utests/utest_helper.hpp +++ b/utests/utest_helper.hpp @@ -52,6 +52,11 @@ OCL_CALL (cl_kernel_init, NAME".cl", NAME, SOURCE); \ } while (0) +#define OCL_CREATE_KERNEL_FROM_FILE(FILE_NAME, KERNEL_NAME) \ + do { \ + OCL_CALL(cl_kernel_init, FILE_NAME".cl", KERNEL_NAME, SOURCE); \ + } while (0) + #define OCL_CREATE_BUFFER(BUFFER, FLAGS, SIZE, DATA) \ do { \ cl_int status; \ |