[Mesa-dev] [PATCH 2/2] clover: clCompileProgram CL_INVALID_COMPILER_OPTIONS

Tom Stellard tom at stellard.net
Tue Dec 2 08:28:16 PST 2014


On Mon, Nov 10, 2014 at 07:04:54PM +0200, Francisco Jerez wrote:
> EdB <edb+mesa at sigluy.net> writes:
> 
> > clCompileProgram should return CL_INVALID_COMPILER_OPTIONS
> > instead of CL_INVALID_BUILD_OPTIONS
> 
> Looks good to me,
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>

I've pushed this, thanks!

-Tom
> 
> > ---
> >  src/gallium/state_trackers/clover/api/program.cpp     | 2 ++
> >  src/gallium/state_trackers/clover/llvm/invocation.cpp | 2 +-
> >  2 files changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
> > index 3a6c054..60184ed 100644
> > --- a/src/gallium/state_trackers/clover/api/program.cpp
> > +++ b/src/gallium/state_trackers/clover/api/program.cpp
> > @@ -182,6 +182,8 @@ clBuildProgram(cl_program d_prog, cl_uint num_devs,
> >     prog.build(devs, opts);
> >     return CL_SUCCESS;
> >  } 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();
> > diff --git a/src/gallium/state_trackers/clover/llvm/invocation.cpp b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > index d29f5a6..30547d0 100644
> > --- a/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > +++ b/src/gallium/state_trackers/clover/llvm/invocation.cpp
> > @@ -177,7 +177,7 @@ namespace {
> >                                          opts_carray.data() + opts_carray.size(),
> >                                          Diags);
> >        if (!Success) {
> > -         throw error(CL_INVALID_BUILD_OPTIONS);
> > +         throw error(CL_INVALID_COMPILER_OPTIONS);
> >        }
> >        c.getFrontendOpts().ProgramAction = clang::frontend::EmitLLVMOnly;
> >        c.getHeaderSearchOpts().UseBuiltinIncludes = true;
> > -- 
> > 1.9.3
> >
> > _______________________________________________
> > mesa-dev mailing list
> > mesa-dev at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev




> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev



More information about the mesa-dev mailing list