diff options
author | Luo Xionghu <xionghu.luo@intel.com> | 2015-11-26 13:59:59 +0800 |
---|---|---|
committer | Yang Rong <rong.r.yang@intel.com> | 2015-12-09 11:42:41 +0800 |
commit | d47346045626e9f5023e0058b6e6d3ca72818a1f (patch) | |
tree | 8ffb68754bf5dd448822a0d9d6570a30057b9282 | |
parent | 7f4ff626b590ebd0fc76220da64a1f575a96cafc (diff) |
runtime: initialize the memory content to 0.
v2: move the memset inside the pointer check.
Signed-off-by: Luo Xionghu <xionghu.luo@intel.com>
Reviewed-by: Yang Rong <rong.r.yang@intel.com>
-rw-r--r-- | src/cl_api.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/cl_api.c b/src/cl_api.c index 1dd6410f..bb56cc53 100644 --- a/src/cl_api.c +++ b/src/cl_api.c @@ -58,6 +58,7 @@ typedef intptr_t cl_device_partition_property; if (param_value && param_value_size < sizeof(TYPE)*ELT) \ return CL_INVALID_VALUE; \ if (param_value) { \ + memset(param_value, 0, param_value_size); \ memcpy(param_value, (VAL), sizeof(TYPE)*ELT); \ } \ \ |