[Mesa-dev] [PATCH] clover: handle setKernelArg errors
Zoltán Gilián
zoltan.gilian at gmail.com
Fri Jul 31 07:05:49 PDT 2015
Could you please commit this? I don't have permissions.
On Fri, Jul 31, 2015 at 3:55 PM, Francisco Jerez <currojerez at riseup.net> wrote:
> Zoltan Gilian <zoltan.gilian at gmail.com> writes:
>
>> ---
>> src/gallium/state_trackers/clover/core/kernel.cpp | 15 +++++++++++++++
>> 1 file changed, 15 insertions(+)
>>
>> diff --git a/src/gallium/state_trackers/clover/core/kernel.cpp b/src/gallium/state_trackers/clover/core/kernel.cpp
>> index a23cd2b..820a80a 100644
>> --- a/src/gallium/state_trackers/clover/core/kernel.cpp
>> +++ b/src/gallium/state_trackers/clover/core/kernel.cpp
>> @@ -366,6 +366,9 @@ kernel::scalar_argument::scalar_argument(size_t size) : size(size) {
>>
>> void
>> kernel::scalar_argument::set(size_t size, const void *value) {
>> + if (!value)
>> + throw error(CL_INVALID_ARG_VALUE);
>> +
>> if (size != this->size)
>> throw error(CL_INVALID_ARG_SIZE);
>>
>> @@ -434,6 +437,9 @@ kernel::local_argument::set(size_t size, const void *value) {
>> if (value)
>> throw error(CL_INVALID_ARG_VALUE);
>>
>> + if (!size)
>> + throw error(CL_INVALID_ARG_SIZE);
>> +
>> _storage = size;
>> _set = true;
>> }
>> @@ -493,6 +499,9 @@ kernel::constant_argument::unbind(exec_context &ctx) {
>>
>> void
>> kernel::image_rd_argument::set(size_t size, const void *value) {
>> + if (!value)
>> + throw error(CL_INVALID_ARG_VALUE);
>> +
>> if (size != sizeof(cl_mem))
>> throw error(CL_INVALID_ARG_SIZE);
>>
>> @@ -521,6 +530,9 @@ kernel::image_rd_argument::unbind(exec_context &ctx) {
>>
>> void
>> kernel::image_wr_argument::set(size_t size, const void *value) {
>> + if (!value)
>> + throw error(CL_INVALID_ARG_VALUE);
>> +
>> if (size != sizeof(cl_mem))
>> throw error(CL_INVALID_ARG_SIZE);
>>
>> @@ -549,6 +561,9 @@ kernel::image_wr_argument::unbind(exec_context &ctx) {
>>
>> void
>> kernel::sampler_argument::set(size_t size, const void *value) {
>> + if (!value)
>> + throw error(CL_INVALID_SAMPLER);
>> +
>> if (size != sizeof(cl_sampler))
>> throw error(CL_INVALID_ARG_SIZE);
>>
>> --
>> 2.4.6
>
> Reviewed-by: Francisco Jerez <currojerez at riseup.net>
More information about the mesa-dev
mailing list