Jan Vesely <jan.ves...@rutgers.edu> writes: > On Sat, 2015-03-21 at 14:57 +0200, Francisco Jerez wrote: >> Jan Vesely <jan.ves...@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. > > Not sure what the rules on using C++11 features are, but we could also > use member initialization. > in kernel.hpp: > > - size_t _storage; > + size_t _storage = 0; >
Yes, that would be a fine solution, probably less typing than defining the constructor explicitly. > jan > >> >> > jan >> > >> >> return _storage; >> >> } >> >> >> > >> > >> > -- >> > Jan Vesely <jan.ves...@rutgers.edu> >> > _______________________________________________ >> > mesa-dev mailing list >> > mesa-dev@lists.freedesktop.org >> > http://lists.freedesktop.org/mailman/listinfo/mesa-dev > > > -- > Jan Vesely <jan.ves...@rutgers.edu>
signature.asc
Description: PGP signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev