[Mesa-dev] [PATCH] clover: clGetProgramInfo support for OpenCL 1.2

EdB edb+mesa at sigluy.net
Sat Aug 16 19:45:32 PDT 2014


On Saturday, August 16, 2014 08:57:01 PM Francisco Jerez wrote:
> EdB <edb+mesa at sigluy.net> writes:
> > ---
> > 
> >  src/gallium/state_trackers/clover/api/program.cpp | 18 ++++++++++++++++++
> >  1 file changed, 18 insertions(+)
> > 
> > diff --git a/src/gallium/state_trackers/clover/api/program.cpp
> > b/src/gallium/state_trackers/clover/api/program.cpp index
> > b81ce69..05f3840 100644
> > --- a/src/gallium/state_trackers/clover/api/program.cpp
> > +++ b/src/gallium/state_trackers/clover/api/program.cpp
> > @@ -232,6 +232,24 @@ clGetProgramInfo(cl_program d_prog, cl_program_info
> > param,> 
> >           prog.devices());
> >        
> >        break;
> > 
> > +   case CL_PROGRAM_NUM_KERNELS:
> > +      buf.as_scalar<cl_uint>() = prog.symbols().size();
> > +      break;
> > +
> > +   case CL_PROGRAM_KERNEL_NAMES: {
> > +      std::string names;
> > +      for (auto &symbol : prog.symbols()) {
> > +         std::string name(symbol.name.begin(), symbol.name.size());
> > +         name += ";";
> > +         names += name;
> > +      }
> > +      if (!names.empty())
> > +         names.pop_back(); //remove ';'
> > +
> > +      buf.as_string() = names;
> > +      }
> > +      break;
> > +
> 
> How about we implement this using fold()?  It's quite a bit more
> concise.  See attachment.

Indeed.
Tested, it works the same

Thanks

> 
> >     default:
> >        throw error(CL_INVALID_VALUE);
> >     
> >     }
> > 
> > _______________________________________________
> > 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