aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover
diff options
context:
space:
mode:
authorJan Vesely <[email protected]>2016-08-28 04:08:15 -0400
committerJan Vesely <[email protected]>2016-08-29 14:40:15 -0400
commit083746bc4811944dcc25c5b6589d7df1bc95eb02 (patch)
tree3ab616555042e4aba114295c7d774e061d98470e /src/gallium/state_trackers/clover
parentc7af84968d4ee0f67c46c347c6fb83d6fbc83ef3 (diff)
clover: Use device cap to query pointer size instead of hardcoded 32bits
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97513 Signed-off-by: Jan Vesely <[email protected]> Reviewed-by: Francisco Jerez <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/clover')
-rw-r--r--src/gallium/state_trackers/clover/api/device.cpp2
-rw-r--r--src/gallium/state_trackers/clover/core/device.cpp6
-rw-r--r--src/gallium/state_trackers/clover/core/device.hpp1
3 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index 11f21e94eae..f7bd61b929b 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -158,7 +158,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
break;
case CL_DEVICE_ADDRESS_BITS:
- buf.as_scalar<cl_uint>() = 32;
+ buf.as_scalar<cl_uint>() = dev.address_bits();
break;
case CL_DEVICE_MAX_READ_IMAGE_ARGS:
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 39f39f436c6..8825f993a75 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -193,6 +193,12 @@ device::subgroup_size() const {
PIPE_COMPUTE_CAP_SUBGROUP_SIZE)[0];
}
+cl_uint
+device::address_bits() const {
+ return get_compute_param<uint32_t>(pipe, ir_format(),
+ PIPE_COMPUTE_CAP_ADDRESS_BITS)[0];
+}
+
std::string
device::device_name() const {
return pipe->get_name(pipe);
diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
index 285784744f3..6cf6c7fcb24 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -68,6 +68,7 @@ namespace clover {
std::vector<size_t> max_block_size() const;
cl_uint subgroup_size() const;
+ cl_uint address_bits() const;
std::string device_name() const;
std::string vendor_name() const;
enum pipe_shader_ir ir_format() const;