[Mesa-stable] [PATCH] clover: Optionally return context's devices from clGetProgramInfo()

Francisco Jerez currojerez at riseup.net
Fri Nov 15 16:37:40 PST 2013


Tom Stellard <tom at stellard.net> writes:

> From: Tom Stellard <thomas.stellard at amd.com>
>
> The spec allows clGetProgramInfo() to return information about either
> the devices associated with the program or the devices associated
> with the context.  If there are no devices associated with the program,
> then we return devices associated with the context.
>
> https://bugs.freedesktop.org/show_bug.cgi?id=52171
>
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

> CC: "10.0" <mesa-stable at lists.freedesktop.org>
> ---
>  src/gallium/state_trackers/clover/api/program.cpp | 8 ++++++--
>  1 file changed, 6 insertions(+), 2 deletions(-)
>
> diff --git a/src/gallium/state_trackers/clover/api/program.cpp b/src/gallium/state_trackers/clover/api/program.cpp
> index 5ef1be6..7d060c4 100644
> --- a/src/gallium/state_trackers/clover/api/program.cpp
> +++ b/src/gallium/state_trackers/clover/api/program.cpp
> @@ -173,11 +173,15 @@ clGetProgramInfo(cl_program d_prog, cl_program_info param,
>        break;
>  
>     case CL_PROGRAM_NUM_DEVICES:
> -      buf.as_scalar<cl_uint>() = prog.devices().size();
> +      buf.as_scalar<cl_uint>() = prog.devices().size() ?
> +                                 prog.devices().size() :
> +                                 prog.ctx.devs().size();
>        break;
>  
>     case CL_PROGRAM_DEVICES:
> -      buf.as_vector<cl_device_id>() = descs(prog.devices());
> +      buf.as_vector<cl_device_id>() = prog.devices().size() ?
> +                                      descs(prog.devices()) :
> +                                      descs(prog.ctx.devs());
>        break;
>  
>     case CL_PROGRAM_SOURCE:
> -- 
> 1.8.1.4
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-stable/attachments/20131115/cb1640b3/attachment.pgp>


More information about the mesa-stable mailing list