Refine error check in SetKernelArg() and support NULL buffer argument
1. refine error check in clSetKernelArg() to follow spec.
2. add support NULL buffer as argument, so user could write like below:
__kernel void func(__global int * p1, constant int* p2) {
if(p1) {
//do some thing if p1 is not NULL.
} else {
//do other things if p1 is NULL
}
}
Then calling clSetKernelArg(k, 0, sizeof(cl_mem), NULL);
3. as there maybe small possibility that we get a 0 starting address for bo,
we add an assert() to make sure we do not get a 0 addressed bo.
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>