[Mesa-stable] [PATCH] clover: Return CL_BUILD_ERROR for CL_PROGRAM_BUILD_STATUS when compilation fails
Francisco Jerez
currojerez at riseup.net
Tue Mar 24 13:24:27 PDT 2015
Tom Stellard <thomas.stellard at amd.com> writes:
> Cc: 10.5 10.4 <mesa-stable at lists.freedesktop.org>
> ---
> src/gallium/state_trackers/clover/core/program.cpp | 6 +++++-
> src/gallium/state_trackers/clover/core/program.hpp | 1 +
> 2 files changed, 6 insertions(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/program.cpp b/src/gallium/state_trackers/clover/core/program.cpp
> index 8553ca7..06a6d92 100644
> --- a/src/gallium/state_trackers/clover/core/program.cpp
> +++ b/src/gallium/state_trackers/clover/core/program.cpp
> @@ -49,6 +49,7 @@ program::build(const ref_vector<device> &devs, const char *opts,
> _binaries.erase(&dev);
> _logs.erase(&dev);
> _opts.erase(&dev);
> + _errs.erase(&dev);
>
> _opts.insert({ &dev, opts });
>
> @@ -65,6 +66,7 @@ program::build(const ref_vector<device> &devs, const char *opts,
> _logs.insert({ &dev, log });
> } catch (const build_error &) {
> _logs.insert({ &dev, log });
> + _errs.insert(&dev);
> throw;
> }
> }
> @@ -88,7 +90,9 @@ program::binary(const device &dev) const {
>
> cl_build_status
> program::build_status(const device &dev) const {
> - if (_binaries.count(&dev))
> + if (_errs.count(&dev))
> + return CL_BUILD_ERROR;
> + else if (_binaries.count(&dev))
> return CL_BUILD_SUCCESS;
> else
> return CL_BUILD_NONE;
Any reason you couldn't do something like:
| if (_binaries.count(&dev))
| return CL_BUILD_SUCCESS;
| else if (_log.count(&dev))
| return CL_BUILD_ERROR;
| else
| return CL_BUILD_NONE;
> diff --git a/src/gallium/state_trackers/clover/core/program.hpp b/src/gallium/state_trackers/clover/core/program.hpp
> index 661fa03..8c90199 100644
> --- a/src/gallium/state_trackers/clover/core/program.hpp
> +++ b/src/gallium/state_trackers/clover/core/program.hpp
> @@ -73,6 +73,7 @@ namespace clover {
> std::map<const device *, module> _binaries;
> std::map<const device *, std::string> _logs;
> std::map<const device *, std::string> _opts;
> + std::set<const device *> _errs;
> std::string _source;
> ref_counter _kernel_ref_counter;
> };
> --
> 2.0.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-stable/attachments/20150324/41e667e2/attachment.sig>
More information about the mesa-stable
mailing list