summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorGrigori Goronzy <greg@chown.ath.cx>2015-05-12 02:22:12 +0200
committerGrigori Goronzy <greg@chown.ath.cx>2015-05-24 01:14:48 +0200
commit5c495e86388b55af067677e8608eb124a5d70d29 (patch)
tree4831d1214727df07ae98eab15c2d90a2b3f378d0 /src/gallium
parentc922758685932e86d935972980df3be22d7b2fdf (diff)
clover: implement CL_MEM_ALLOC_HOST_PTR
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. Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/state_trackers/clover/core/resource.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/core/resource.cpp b/src/gallium/state_trackers/clover/core/resource.cpp
index bcf87e15480..8ed4c4284e1 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;
+ }
+
pipe = dev.pipe->resource_create(dev.pipe, &info);
if (!pipe)
throw error(CL_OUT_OF_RESOURCES);