clover: try userptr for CL_MEM_USE_HOST_PTR
authorGrigori Goronzy <greg@chown.ath.cx>
Tue, 19 May 2015 07:28:30 +0000 (09:28 +0200)
committerGrigori Goronzy <greg@chown.ath.cx>
Sat, 23 May 2015 23:14:49 +0000 (01:14 +0200)
commitf972b223c4cb4ec58a9451cbac5d120ac9deb336
tree997d133fdfc43c5a9abe62b3ceb34886b727b2a5
parent5c495e86388b55af067677e8608eb124a5d70d29
clover: try userptr for CL_MEM_USE_HOST_PTR

According to spec, CL_MEM_USE_HOST_PTR should directly use host memory,
if possible. This is just what userptr is for, so use it.

In case the memory cannot be mapped, a fallback similar to
CL_MEM_COPY_HOST_PTR is used.

v2: constify, drop unneeded cast

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/core/memory.cpp
src/gallium/state_trackers/clover/core/resource.cpp