summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-01-14 12:45:12 -0800
committerTom Stellard <thomas.stellard@amd.com>2014-01-14 12:45:12 -0800
commit96102d20c21ee0fdb2c56e1a984e5d61f3d06f74 (patch)
tree86984c99b183d594774de4327d464f20ee73bb01
parent7a8641550c0df22e1e59dca8552c8cceb3b8c436 (diff)
clover: Query drivers for max clock frequencyclover-clock
-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 7bc8d0a7142..f98084533d7 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -122,7 +122,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
break;
case CL_DEVICE_MAX_CLOCK_FREQUENCY:
- buf.as_scalar<cl_uint>() = 0;
+ buf.as_scalar<cl_uint>() = dev.max_clock_frequency();
break;
case CL_DEVICE_ADDRESS_BITS:
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index e5e429a4471..1ab2913a84a 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -151,6 +151,12 @@ device::max_mem_alloc_size() const {
PIPE_COMPUTE_CAP_MAX_MEM_ALLOC_SIZE)[0];
}
+cl_uint
+device::max_clock_frequency() const {
+ return get_compute_param<uint32_t>(pipe,
+ PIPE_COMPUTE_MAX_CLOCK_FREQUENCY)[0];
+}
+
std::vector<size_t>
device::max_block_size() const {
auto v = get_compute_param<uint64_t>(pipe, PIPE_COMPUTE_CAP_MAX_BLOCK_SIZE);
diff --git a/src/gallium/state_trackers/clover/core/device.hpp b/src/gallium/state_trackers/clover/core/device.hpp
index 433ac814c21..3662c6be0fe 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -61,6 +61,7 @@ namespace clover {
cl_uint max_const_buffers() const;
size_t max_threads_per_block() const;
cl_ulong max_mem_alloc_size() const;
+ cl_uint max_clock_frequency() const;
std::vector<size_t> max_block_size() const;
std::string device_name() const;