On Jul 2, 2014, at 12:52 PM, Matt Arsenault <arse...@gmail.com> wrote:
> > On Jul 2, 2014, at 12:48 PM, Tom Stellard <thomas.stell...@amd.com> wrote: > >> --- >> 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 97b2cf9..3b91e9e 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 b6078db..498e7d9 100644 >> --- a/src/gallium/state_trackers/clover/core/device.cpp >> +++ b/src/gallium/state_trackers/clover/core/device.cpp >> @@ -169,6 +169,12 @@ device::max_compute_units() const { >> PIPE_COMPUTE_CAP_MAX_COMPUTE_UNITS)[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; >> +} > > Probably shouldn’t include CL_FP_DENORM as the default. It should be false on > R600/SI, and probably many other devices > > The spec says the mandated minimum for single precision on non-custom devices is CL_FP_ROUND_TO_NEAREST | CL_FP_INF_NAN, so without a device query that should be the default >> + >> 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 731c31e..93f9091 100644 >> --- a/src/gallium/state_trackers/clover/core/device.hpp >> +++ b/src/gallium/state_trackers/clover/core/device.hpp >> @@ -63,6 +63,7 @@ namespace clover { >> cl_ulong max_mem_alloc_size() const; >> cl_uint max_clock_frequency() const; >> cl_uint max_compute_units() const; >> + cl_device_fp_config single_fp_config() const; >> >> std::vector<size_t> max_block_size() const; >> std::string device_name() const; >> -- >> 1.8.1.5 >> >> _______________________________________________ >> mesa-dev mailing list >> mesa-dev@lists.freedesktop.org >> http://lists.freedesktop.org/mailman/listinfo/mesa-dev
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev