From bad91d101e6587afec3d06d8b7e182ba3c136bb7 Mon Sep 17 00:00:00 2001 From: Gil Pitney Date: Wed, 29 Jun 2016 22:09:06 +0000 Subject: Fixed erroneous determination of number of kernels associated with a program Previously, CL_INVALID_OPERATION was being returned when trying to compile a binary loaded program. This is fixed, enabling now all 72 of the v1.2 Khronos API conformance tests to pass. Signed-off-by: Gil Pitney --- src/core/program.cpp | 2 +- tests/api_test_failures.lst | 36 ------------------------------------ 2 files changed, 1 insertion(+), 37 deletions(-) delete mode 100644 tests/api_test_failures.lst diff --git a/src/core/program.cpp b/src/core/program.cpp index 9e2703e..1b981da 100644 --- a/src/core/program.cpp +++ b/src/core/program.cpp @@ -603,7 +603,7 @@ cl_int Program::compile(const char *options, // Note this causes some Khronos tests to fail, like test_compiler options_build_macro, // options_build_macro_existence, and options_include_directory, and // test_api binary_create, as they all violate the spec in this regard. - if (getNumKernels() > 0) { + if (kernelList.size() > 0) { p_state = Failed; return(CL_INVALID_OPERATION); } diff --git a/tests/api_test_failures.lst b/tests/api_test_failures.lst deleted file mode 100644 index f4c52f5..0000000 --- a/tests/api_test_failures.lst +++ /dev/null @@ -1,36 +0,0 @@ -Khronos API Test Failures -=========================== -Khronos Test Version: OpenCL 1.2 - -Usage: -% cd opencl_conformance/test_conformance/api -% test_api - - -: -Failure Mode: -Analysis: - -binary_create -============= -Failure Mode: ------------- -ERROR: Unable to build binary program! (CL_INVALID_OPERATION from /home/gpitney/opencl_1_2_conformance/test_conformance/api/test_binary.cpp:113) - - -Analysis: ---------- -This is expected. It is my claim that this test is violating the spec, by -attempting to build a proram with kernels already attached to the program. - -See this comment in src/core/program.cpp: -// 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 options_build_macro_existence options_include_directory, and -// test_api binary_create, as they all violate the spec in this regard. - if (getNumKernels() > 0) { - p_state = Failed; - return(CL_INVALID_OPERATION); - } - -- cgit v1.2.3