[Mesa-dev] [PATCH] clover: Return 0 as storage size for local kernel args that are not set

Francisco Jerez currojerez at riseup.net
Sat Mar 21 05:57:34 PDT 2015


Jan Vesely <jan.vesely at rutgers.edu> writes:

> 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?
>
Yes, the local_argument class could really use a constructor.

> jan
>
>>     return _storage;
>>  }
>>  
>
>
> -- 
> Jan Vesely <jan.vesely at rutgers.edu>
> _______________________________________________
> 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: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150321/ce168f1e/attachment.sig>


More information about the mesa-dev mailing list