[Mesa-dev] [PATCH 3/5] clover: Report default values for half and double fp configs v2

Francisco Jerez currojerez at riseup.net
Thu Jun 26 07:09:32 PDT 2014


Tom Stellard <thomas.stellard at amd.com> writes:

> From: Matt Arsenault <arsenm2 at gmail.com>
>
> v2:
>   -Fix indentation
> ---
>  src/gallium/state_trackers/clover/api/device.cpp  | 11 +++++++++--
>  src/gallium/state_trackers/clover/core/device.cpp | 24 +++++++++++++++++++++++
>  src/gallium/state_trackers/clover/core/device.hpp |  3 +++
>  3 files changed, 36 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..7006702 100644
> --- a/src/gallium/state_trackers/clover/api/device.cpp
> +++ b/src/gallium/state_trackers/clover/api/device.cpp
> @@ -201,8 +201,15 @@ 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_DOUBLE_FP_CONFIG:
> +      buf.as_scalar<cl_device_fp_config>() = dev.double_fp_config();
> +      break;
> +
> +   case CL_DEVICE_HALF_FP_CONFIG:
> +      buf.as_scalar<cl_device_fp_config>() = dev.half_fp_config();
>        break;


We need some mechanism to find out if the device supports half
precision.  Until then can you drop this case statement and
device::half_fp_config()?

>  
>     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..bc6b761 100644
> --- a/src/gallium/state_trackers/clover/core/device.cpp
> +++ b/src/gallium/state_trackers/clover/core/device.cpp
>[...]
> +cl_device_fp_config
> +device::double_fp_config() const {
> +   // TODO: Get these from somewhere. This is the "mandated minimum double
> +   // precision floating-point capability"
> +   return CL_FP_FMA
> +       | CL_FP_ROUND_TO_NEAREST
> +       | CL_FP_ROUND_TO_ZERO
> +       | CL_FP_ROUND_TO_INF
> +       | CL_FP_INF_NAN
> +       | CL_FP_DENORM;

This should probably return 0 if the device doesn't support doubles.

>[...]
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 229 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/mesa-dev/attachments/20140626/838b7660/attachment.sig>


More information about the mesa-dev mailing list