summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/clover/core
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2014-07-02 15:42:43 -0400
committerTom Stellard <thomas.stellard@amd.com>2015-03-05 14:07:37 +0000
commitc97e902a1a69892147e7649581951747f03afaee (patch)
treec874a49de762e6142105e09f239e64034b003267 /src/gallium/state_trackers/clover/core
parent8d8ca64c28170ec7e9ffa01638bcf8fd30a96088 (diff)
downloadexternal_mesa3d-c97e902a1a69892147e7649581951747f03afaee.zip
external_mesa3d-c97e902a1a69892147e7649581951747f03afaee.tar.gz
external_mesa3d-c97e902a1a69892147e7649581951747f03afaee.tar.bz2
clover: Enable cl_khr_fp64 for devices that support doubles v4
v2: - Report correct values for CL_DEVICE_NATIVE_VECTOR_WIDTH_DOUBLE and CL_DEVICE_PREFERRED_VECTOR_WIDTH_DOUBLE. - Only define cl_khr_fp64 if the extension is supported. - Remove trailing space from extension string. - Rename device query function from cl_khr_fp64() to has_doubles(). v3: - Return 0 for device::doubled_fp_confg() when doubles aren't supported. v4: - Remove device query for double fp_config. Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Diffstat (limited to 'src/gallium/state_trackers/clover/core')
-rw-r--r--src/gallium/state_trackers/clover/core/device.cpp6
-rw-r--r--src/gallium/state_trackers/clover/core/device.hpp1
2 files changed, 7 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 688a7dd..c3f3b4e 100644
--- a/src/gallium/state_trackers/clover/core/device.cpp
+++ b/src/gallium/state_trackers/clover/core/device.cpp
@@ -173,6 +173,12 @@ device::image_support() const {
PIPE_COMPUTE_CAP_IMAGES_SUPPORTED)[0];
}
+bool
+device::has_doubles() const {
+ return pipe->get_shader_param(pipe, PIPE_SHADER_COMPUTE,
+ PIPE_SHADER_CAP_DOUBLES);
+}
+
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 2201700..de5fc6b 100644
--- a/src/gallium/state_trackers/clover/core/device.hpp
+++ b/src/gallium/state_trackers/clover/core/device.hpp
@@ -64,6 +64,7 @@ namespace clover {
cl_uint max_clock_frequency() const;
cl_uint max_compute_units() const;
bool image_support() const;
+ bool has_doubles() const;
std::vector<size_t> max_block_size() const;
std::string device_name() const;