[Mesa-dev] [PATCH 1/2] clover: implement CL_MEM_ALLOC_HOST_PTR

Francisco Jerez currojerez at riseup.net
Sat May 23 06:44:55 PDT 2015


Grigori Goronzy <greg at chown.ath.cx> writes:

> This flag is typically used to request pinned host memory, to avoid
> any copies between GPU and CPU.
>
> This improves throughput with an older OpenCL app which I unfortunately
> can't publish due to its licensing.
> ---
>  src/gallium/state_trackers/clover/core/resource.cpp | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp
> index bcf87e1..8ed4c42 100644
> --- a/src/gallium/state_trackers/clover/core/resource.cpp
> +++ b/src/gallium/state_trackers/clover/core/resource.cpp
> @@ -137,6 +137,10 @@ root_resource::root_resource(clover::device &dev, memory_obj &obj,
>                  PIPE_BIND_TRANSFER_READ |
>                  PIPE_BIND_TRANSFER_WRITE);
>  
> +   if (obj.flags() & CL_MEM_ALLOC_HOST_PTR) {
> +      info.usage = PIPE_USAGE_STAGING;
> +   }
> +

Thank you,
Reviewed-by: Francisco Jerez <currojerez at riseup.net>

>     pipe = dev.pipe->resource_create(dev.pipe, &info);
>     if (!pipe)
>        throw error(CL_OUT_OF_RESOURCES);
> -- 
> 1.9.1
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 212 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20150523/9edd9235/attachment.sig>


More information about the mesa-dev mailing list