[Mesa-dev] [PATCH 1/5] clover/memory: Copy data when creating buffers with CL_MEM_USE_HOST_PTR
Jan Vesely
jan.vesely at rutgers.edu
Sat Jul 22 19:27:07 UTC 2017
On Fri, 2017-07-21 at 23:19 -0500, Aaron Watry wrote:
> Fixes: OpenCL CTS test/conformance/buffers/buffer_copy
Similar patch was pushed in 2013:
56647c5d8f8e60269f0a3277e3caa7ee57d1fe6a
"clover: Append buffers that use CL_MEM_USE_HOST_PTR."
Grigory(added to cc) reverted the change and implemented user_ptr
mechanism in:
f972b223c4cb4ec58a9451cbac5d120ac9deb336
"clover: try userptr for CL_MEM_USE_HOST_PTR"
The buffer-flags piglit still passes, but it maps even CL_USE_HOST_PTR
buffers. I'm not sure what the CTS does, we might need a
synchronization point after kernels finish execution. I couldn't find
the relevant part of specs that would define accessing
CL_MEM_USE_HOST_PTR buffers without
clEnqueueMapBuffer or clEnqueueReadBuffer
Jan
>
> Signed-off-by: Aaron Watry <awatry at gmail.com>
> CC: Francisco Jerez <currojerez at riseup.net>
> ---
> src/gallium/state_trackers/clover/core/memory.cpp | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/src/gallium/state_trackers/clover/core/memory.cpp b/src/gallium/state_trackers/clover/core/memory.cpp
> index b852e6896f..912d74830a 100644
> --- a/src/gallium/state_trackers/clover/core/memory.cpp
> +++ b/src/gallium/state_trackers/clover/core/memory.cpp
> @@ -30,7 +30,7 @@ memory_obj::memory_obj(clover::context &ctx, cl_mem_flags flags,
> size_t size, void *host_ptr) :
> context(ctx), _flags(flags),
> _size(size), _host_ptr(host_ptr) {
> - if (flags & CL_MEM_COPY_HOST_PTR)
> + if (flags & (CL_MEM_COPY_HOST_PTR | CL_MEM_USE_HOST_PTR))
> data.append((char *)host_ptr, size);
> }
>
--
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/mesa-dev/attachments/20170722/147f03e2/attachment.sig>
More information about the mesa-dev
mailing list