[Mesa-dev] [PATCH] clover: Return 0 as storage size for local kernel args that are not set
Jan Vesely
jan.vesely at rutgers.edu
Fri Mar 20 23:02:01 PDT 2015
On Fri, 2015-03-20 at 23:29 +0000, Tom Stellard wrote:
> The storage size for local kernel args can be queried before the
> arguments are set by using the CL_KERNEL_LOCAL_MEM_SIZE param
> of clGetKernelWorkGroupInfo().
>
> The spec says that if local kernel arguments have not been specified,
> then we should assume their size is 0.
> ---
> src/gallium/state_trackers/clover/core/kernel.cpp | 2 ++
> 1 file changed, 2 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
> index 442762c..f4f8616 100644
> --- a/src/gallium/state_trackers/clover/core/kernel.cpp
> +++ b/src/gallium/state_trackers/clover/core/kernel.cpp
> @@ -399,6 +399,8 @@ kernel::global_argument::unbind(exec_context &ctx) {
>
> size_t
> kernel::local_argument::storage() const {
> + if (!_set)
> + return 0;
Shouldn't _storage be 0 before anybody calls local_argument::set anyway?
maybe initializing it in a constructor would suffice?
jan
> return _storage;
> }
>
--
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/20150321/812f10a7/attachment.sig>
More information about the mesa-dev
mailing list