clover: Append buffers that use CL_MEM_USE_HOST_PTR.
authorJan Vesely <jan.vesely@rutgers.edu>
Sun, 15 Dec 2013 22:28:16 +0000 (17:28 -0500)
committerFrancisco Jerez <currojerez@riseup.net>
Wed, 18 Dec 2013 15:21:59 +0000 (16:21 +0100)
Specs say it's legal for implementations to use internal copies, and
the write synchronization seems to work.  Fixes clCreateBuffer
(together with previous patches) and buffer-flags piglits.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Acked-by: Francisco Jerez <currojerez@riseup.net>
src/gallium/state_trackers/clover/core/memory.cpp

index 87a9f7a5488b541d1a21b45170748d822b1cf8c9..1db3f68d371c4fbecc4af7c3fe6dc410cdb768bc 100644 (file)
@@ -31,7 +31,7 @@ memory_obj::memory_obj(context &ctx, cl_mem_flags flags,
    ctx(ctx), _flags(flags),
    _size(size), _host_ptr(host_ptr),
    _destroy_notify([]{}) {
-   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);
 }