summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAaron Watry <[email protected]>2017-06-02 21:51:43 -0500
committerAaron Watry <[email protected]>2017-06-13 21:26:09 -0500
commitd364ab4a615b762b3684fa292590ef4cfaba9ea8 (patch)
treee0237d98f0d3758a20c928476df4563752b56b2b
parent1307ed430a13dfb92d6ecd843dca02cb1739b6a6 (diff)
clover/device: Get device/host unified memory from pipe driver
clinfo no longer reports my discrete GCN card as unified memory Signed-off-by: Aaron Watry <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
-rw-r--r--src/gallium/state_trackers/clover/api/device.cpp2
-rw-r--r--src/gallium/state_trackers/clover/core/device.cpp5
-rw-r--r--src/gallium/state_trackers/clover/core/device.hpp1
3 files changed, 7 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index a80ca46654f..0b33350bb2e 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -336,7 +336,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
break;
case CL_DEVICE_HOST_UNIFIED_MEMORY:
- buf.as_scalar<cl_bool>() = CL_TRUE;
+ buf.as_scalar<cl_bool>() = dev.has_unified_memory();
break;
case CL_DEVICE_NATIVE_VECTOR_WIDTH_CHAR:
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 158c9aa6964..8dfba1ad9fd 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -189,6 +189,11 @@ device::has_doubles() const {
return pipe->get_param(pipe, PIPE_CAP_DOUBLES);
}
+bool
+device::has_unified_memory() const {
+ return pipe->get_param(pipe, PIPE_CAP_UMA);
+}
+
std::vector<size_t>
device::max_block_size() const {
auto v = get_compute_param<uint64_t>(pipe, ir_format(),
diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
index 94a61d10500..7b3353df345 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -67,6 +67,7 @@ namespace clover {
cl_uint max_compute_units() const;
bool image_support() const;
bool has_doubles() const;
+ bool has_unified_memory() const;
std::vector<size_t> max_block_size() const;
cl_uint subgroup_size() const;