[Piglit] [PATCH] CL: Add tests to make sure that ilogb(0.0 or nan) returns FP_ILOGB0|FP_ILOGBNAN

Jan Vesely jan.vesely at rutgers.edu
Tue Feb 23 16:13:34 UTC 2016


On Mon, 2016-02-22 at 20:38 -0600, Aaron Watry wrote:
> Signed-off-by: Aaron Watry <awatry at gmail.com>

Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>


> ---
>  tests/cl/program/execute/builtin/math/ilogb.cl | 31
> ++++++++++++++++++++++++++
>  1 file changed, 31 insertions(+)
>  create mode 100644 tests/cl/program/execute/builtin/math/ilogb.cl
> 
> diff --git a/tests/cl/program/execute/builtin/math/ilogb.cl
> b/tests/cl/program/execute/builtin/math/ilogb.cl
> new file mode 100644
> index 0000000..0b23f2c
> --- /dev/null
> +++ b/tests/cl/program/execute/builtin/math/ilogb.cl
> @@ -0,0 +1,31 @@
> +/*!
> +[config]
> +name: ilogb
> +clc_version_min: 10
> +dimensions: 1
> +
> +[test]
> +name: float scalar ilogb(0.0)
> +kernel_name: ilogb_macro_ilogb0
> +global_size: 1 0 0
> +arg_out: 0 buffer int[1] 0
> +arg_in: 1 buffer float[1] 0.0
> +
> +[test]
> +name: float scalar ilogb(nan)
> +kernel_name: ilogb_macro_ilogbnan
> +global_size: 1 0 0
> +arg_out: 0 buffer int[1] 0
> +arg_in: 1 buffer float[1] nan
> +
> +!*/
> +
> +kernel void ilogb_macro_ilogb0(global int* out, global float* in1) {
> +    size_t id = get_global_id(0);
> +    out[id] = ilogb(in1[id]) - FP_ILOGB0;
> +}
> +
> +kernel void ilogb_macro_ilogbnan(global int* out, global float* in1)
> {
> +    size_t id = get_global_id(0);
> +    out[id] = ilogb(in1[id]) - FP_ILOGBNAN;
> +}
-- 
Jan Vesely <jan.vesely at rutgers.edu>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: This is a digitally signed message part
URL: <https://lists.freedesktop.org/archives/piglit/attachments/20160223/6d6404b6/attachment-0001.sig>


More information about the Piglit mailing list