[Mesa-dev] [PATCH] clover: Return CL_BUILD_ERROR for CL_PROGRAM_BUILD_STATUS when compilation fails

Jan Vesely jan.vesely at rutgers.edu
Tue Mar 24 14:05:38 PDT 2015


On Tue, 2015-03-24 at 22:36 +0200, Francisco Jerez wrote:
> Jan Vesely <jan.vesely at rutgers.edu> writes:
> 
> > On Tue, 2015-03-24 at 22:24 +0200, Francisco Jerez wrote:
> >> 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;
> >> 
> >
> > Wouldn't this return error even if only warnings are produced?
> >
> No, warnings alone wouldn't cause _binaries.count(&dev) to be zero.

ah right, missed that part.
thanks

> 
> >> 
> >> > 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
> >> _______________________________________________
> >> mesa-dev mailing list
> >> mesa-dev at lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
> >
> > -- 
> > Jan Vesely <jan.vesely at rutgers.edu>

-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150324/c00d3094/attachment.sig>


More information about the mesa-dev mailing list