From 4ef1c0918da4363aa20b7c1a91d344fae6c01942 Mon Sep 17 00:00:00 2001 From: Francisco Jerez Date: Sun, 19 Jun 2016 14:31:59 -0700 Subject: clover: Move back to using build_error to signal compilation failure. This partially reverts 7e0180d57d330bd8d3047e841086712376b2a1cc. Having two different exception subclasses for compilation and linking makes it more difficult to share or move code between the two codepaths, because the exact same function under the same error condition would need to throw one exception or the other depending on what top-level API is being implemented with it. There is little benefit anyway because clCompileProgram() and clLinkProgram() can tell whether they are linking or compiling a program. Reviewed-by: Serge Martin Tested-by: Jan Vesely --- src/gallium/state_trackers/clover/api/program.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/gallium/state_trackers/clover/api') diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp index 27ca2efd0bc..ff199abe5c0 100644 --- a/src/gallium/state_trackers/clover/api/program.cpp +++ b/src/gallium/state_trackers/clover/api/program.cpp @@ -186,8 +186,6 @@ clBuildProgram(cl_program d_prog, cl_uint num_devs, } catch (error &e) { if (e.get() == CL_INVALID_COMPILER_OPTIONS) return CL_INVALID_BUILD_OPTIONS; - if (e.get() == CL_COMPILE_PROGRAM_FAILURE) - return CL_BUILD_PROGRAM_FAILURE; return e.get(); } @@ -227,6 +225,9 @@ clCompileProgram(cl_program d_prog, cl_uint num_devs, prog.build(devs, opts, headers); return CL_SUCCESS; +} catch (build_error &e) { + return CL_COMPILE_PROGRAM_FAILURE; + } catch (error &e) { return e.get(); } -- cgit v1.2.3