diff options
author | Gil Pitney <gil.pitney@linaro.org> | 2016-06-30 23:28:06 +0000 |
---|---|---|
committer | Gil Pitney <gil.pitney@linaro.org> | 2016-06-30 23:28:06 +0000 |
commit | ad003b148d7f911eaa27c7c039ee7c7dd1b31461 (patch) | |
tree | 104617053871677ccb4c57c087fd8c1c7216af01 | |
parent | 8bc85173931c31e47726ec57a7babe9fac811460 (diff) |
Document patch to fix bug in test_compile Khronos conformance test
With this patch (taken from Khronos OpenCL v2.0 test suite) the
test_compiler conformance test should pass at 100%.
Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r-- | tests/test_compiler.lst | 70 |
1 files changed, 60 insertions, 10 deletions
diff --git a/tests/test_compiler.lst b/tests/test_compiler.lst index cb7fa50..baada06 100644 --- a/tests/test_compiler.lst +++ b/tests/test_compiler.lst @@ -1,10 +1,60 @@ - Per the v1.2 spec for clBuildProgram() and clCompileProgram(): - "Returns: CL_INVALID_OPERATION if there are kernel objects attached to - program." -Note this causes some Khronos tests to fail, like: - test_compiler options_build_macro, - test_compiler options_build_macro_existence, and - test_compiler options_include_directory - test_api binary_create - -, as they all violate the spec in this regard. +2 of the 55 test_compiler tests fail, but this is due to a bug in the Khronos +conformance tests (which was fixed in the OpenCL v2.0 conformance test suite). + +The patch below is needed to get the following v1.2 tests to pass: + - test_compiler two_file_regular_struct_access + - test_compiler two_file_regular_variable_access + +Without this, they throw an error: + program.cl:9:53: error: variable in constant address space must be initialized + +With this patch, all 55 compiler tests pass. + +PATCH TO APPLY TO KHRONOS v1.2 TESTS: +==================================== +From: Gil Pitney <gil.pitney@linaro.org> +Date: Thu, 30 Jun 2016 23:08:17 +0000 +Subject: [PATCH 7/7] Added a fix taken from Khronos + OpenCL_2_0_Tests_V3_0.tar.gz + +Initialize constant variable declaration in test case. + +This enables the following v1.2 tests to pass: + - test_compiler two_file_regular_struct_access + - test_compiler two_file_regular_variable_access + +Previously, these were throwing an error: + program.cl:9:53: error: variable in constant address space must be initialized + +Signed-off-by: Gil Pitney <gil.pitney@linaro.org> +--- + test_conformance/compiler/test_compile.c | 6 ++++++ + 1 file changed, 6 insertions(+) + +diff --git a/test_conformance/compiler/test_compile.c b/test_conformance/compiler/test_compile +.c +index 410b90f..7d1b1f1 100644 +--- a/test_conformance/compiler/test_compile.c ++++ b/test_conformance/compiler/test_compile.c +@@ -137,8 +137,14 @@ const char* compile_static_var = "static constant float foo = 2.78;\ +n"; + const char* compile_static_struct = "static constant struct bar {float x, y, z, r; int colo +r; } foo = {3.14159};\n"; + const char* compile_static_function = "static int foo(int x, int y) { return x*x + y*y; }\n"; + + ++#if 1 // GP: Fix to test_compile.c taken from Khronos OpenCL_2_0_Tests_V3_0.tar.gz: ++const char* compile_regular_var = "constant float foo = 4.0f;\n"; ++const char* compile_regular_struct = "constant struct bar {float x, y, z, r; int color; } f +oo = {0.f, 0.f, 0.f, 0.f, 0};\n"; ++#else + const char* compile_regular_var = "constant float foo;\n"; + const char* compile_regular_struct = "constant struct bar {float x, y, z, r; int color; } f +oo;\n"; ++#endif ++ + const char* compile_regular_function = "int foo(int x, int y) { return x*x + y*y; }\n"; + + const char* link_static_var_access = // use with compile_static_var +-- +1.9.1 |