On 2014.10.23 06:23:58 +0000, Guo, Yejun wrote: > diff --git a/src/cl_api.c b/src/cl_api.c > index 8a2e999..1c1dd85 100644 > --- a/src/cl_api.c > +++ b/src/cl_api.c > @@ -2653,6 +2653,10 @@ clEnqueueMapBuffer(cl_command_queue command_queue, > data->size = size; > data->ptr = ptr; > data->unsync_map = 1; > + if (map_flags & CL_MAP_READ) > + data->write_map = 0; > + else if (map_flags & (CL_MAP_WRITE | CL_MAP_WRITE_INVALIDATE_REGION)) > + data->write_map = 1; > [yejun] from the perspective of c programming, how about the value of > data->write_map for other conditions. I understand it keeps the initial > value. It would be better to assign the value explicitly, just like: > if (...) > something > else > something >
Might simply write
if (map_flags & (CL_MAP_WRITE | CL_MAP_WRITE_INVALIDATE_REGION))
data->write_map = 1;
--
Open Source Technology Center, Intel ltd.
$gpg --keyserver wwwkeys.pgp.net --recv-keys 4D781827
signature.asc
Description: Digital signature
_______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
