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

Francisco Jerez currojerez at riseup.net
Sun Aug 17 13:37:19 PDT 2014


EdB <edb+mesa at sigluy.net> writes:

> 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
>
OK, pushed as ce4d3f3104b01b6148ce7b1c7ecd354fd2f062c9.

>> 
>> >     default:
>> >        throw error(CL_INVALID_VALUE);
>> >     
>> >     }
>> > 
>> > _______________________________________________
>> > mesa-dev mailing list
>> > mesa-dev at lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140817/1cee66c9/attachment.sig>


More information about the mesa-dev mailing list