[Mesa-dev] [PATCH 1/2] clover: Report a default value for CL_DEVICE_SINGLE_FP_CONFIG

Tom Stellard thomas.stellard at amd.com
Mon Mar 2 07:55:21 PST 2015


---
 src/gallium/state_trackers/clover/api/device.cpp  | 3 +--
 src/gallium/state_trackers/clover/core/device.cpp | 6 ++++++
 src/gallium/state_trackers/clover/core/device.hpp | 1 +
 3 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/src/gallium/state_trackers/clover/api/device.cpp b/src/gallium/state_trackers/clover/api/device.cpp
index e825468..e8750e8 100644
--- a/src/gallium/state_trackers/clover/api/device.cpp
+++ b/src/gallium/state_trackers/clover/api/device.cpp
@@ -201,8 +201,7 @@ clGetDeviceInfo(cl_device_id d_dev, cl_device_info param,
       break;
 
    case CL_DEVICE_SINGLE_FP_CONFIG:
-      buf.as_scalar<cl_device_fp_config>() =
-         CL_FP_DENORM | CL_FP_INF_NAN | CL_FP_ROUND_TO_NEAREST;
+      buf.as_scalar<cl_device_fp_config>() = dev.single_fp_config();
       break;
 
    case CL_DEVICE_GLOBAL_MEM_CACHE_TYPE:
diff --git a/src/gallium/state_trackers/clover/core/device.cpp b/src/gallium/state_trackers/clover/core/device.cpp
index 688a7dd..34f0372 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];
 }
 
+cl_device_fp_config
+device::single_fp_config() const {
+   // TODO: Get these from somewhere.
+   return CL_FP_DENORM | CL_FP_INF_NAN | CL_FP_ROUND_TO_NEAREST;
+}
+
 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..6d3c2c3 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;
+      cl_device_fp_config single_fp_config() const;
 
       std::vector<size_t> max_block_size() const;
       std::string device_name() const;
-- 
2.0.4



More information about the mesa-dev mailing list