[Piglit] [PATCH] cl: Add sqrt tests
Tom Stellard
tom at stellard.net
Sat Oct 26 06:08:14 CEST 2013
On Fri, Oct 25, 2013 at 05:40:47PM -0500, Aaron Watry wrote:
> Pretty basic, but we didn't have any tests for this before...
>
> Tested on r600g w/ CEDAR.
> ---
> generated_tests/generate-cl-math-builtins.py | 8 ++++++++
> 1 file changed, 8 insertions(+)
>
> diff --git a/generated_tests/generate-cl-math-builtins.py b/generated_tests/generate-cl-math-builtins.py
> index b6b4e43..150c412 100644
> --- a/generated_tests/generate-cl-math-builtins.py
> +++ b/generated_tests/generate-cl-math-builtins.py
> @@ -57,6 +57,14 @@ tests = {
> [1.0, -1.0, 0.0, -0.0, 0.0],
> [0.5, -0.5, 0.0, -0.0, float("nan")]
> ]
> + },
> + 'sqrt' : {
> + 'arg_types': [F, F],
> + 'function_type': 'ttt',
> + 'values': [
> + [1.0, 2.0, 6.0, 2.5 , float("nan"), 4.0], # Result
> + [1.0, 4.0, 36.0, 6.25, float("nan"), 16.0], # Arg1
I think you should also add one or more cases here that require a lot of
precision. I'm pretty sure we get this wrong on r600g, since we are
using the instruction that calculates the approximate sqrt.
Also, I think it would be good to add a TODO somewhere in the python
script for checking that the results of the builtins satisfy the ulp
requirements for the spec.
With these changes, the patch is:
Reviewed-by: Tom Stellard <thomas.stellard at amd.com>
> + ]
> }
> }
>
> --
> 1.8.3.2
>
> _______________________________________________
> Piglit mailing list
> Piglit at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/piglit
More information about the Piglit
mailing list