aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGil Pitney <gil.pitney@linaro.org>2016-06-29 22:26:53 +0000
committerGil Pitney <gil.pitney@linaro.org>2016-06-29 22:51:04 +0000
commit8bc85173931c31e47726ec57a7babe9fac811460 (patch)
tree08ff6d86b6ccc193c6a0fa88d1cf6b4ac72dd776
parentbad91d101e6587afec3d06d8b7e182ba3c136bb7 (diff)
downloadshamrock-8bc85173931c31e47726ec57a7babe9fac811460.tar.gz
Add in the logic to resetDeviceDependent upon recompiling a built program
Previously, this was ifdef'd out, but the logic is needed to ensure the program is actually rebuilt if the client rebuild the same program with different user options. This enables the following 3 test_compiler Khronos test cases to pass: % test_compiler options_build_macro options_build_macro_existence options_include_directory Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
-rw-r--r--src/core/program.cpp15
1 files changed, 5 insertions, 10 deletions
diff --git a/src/core/program.cpp b/src/core/program.cpp
index 1b981da..1158cfd 100644
--- a/src/core/program.cpp
+++ b/src/core/program.cpp
@@ -592,22 +592,17 @@ cl_int Program::compile(const char *options,
{
cl_int retcode = CL_SUCCESS;
-#if 0
- // If we've already built this program and are re-building
- // (for example, with different user options) then clear out the
- // device dependent information in preparation for building again.
- if( p_state == Built || p_state == Compiled) resetDeviceDependent();
-#else
// 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, and options_include_directory, and
- // test_api binary_create, as they all violate the spec in this regard.
if (kernelList.size() > 0) {
p_state = Failed;
return(CL_INVALID_OPERATION);
}
-#endif
+
+ // If we've already built this program and are re-building
+ // (for example, with different user options) then clear out the
+ // device dependent information in preparation for building again.
+ if( p_state == Built || p_state == Compiled) resetDeviceDependent();
p_state = Failed;