[Piglit] [PATCH] Generated tests: unify code for testing exp2 across all numpy versions.

Kenneth Graunke kenneth at whitecape.org
Tue Aug 9 23:12:40 PDT 2011


On 08/08/2011 04:04 PM, Paul Berry wrote:
> Versions of numpy previous to 1.3.0 (such as the one that ships with
> Snow Leopard, which is 1.2.1) didn't include an exp2() function, so
> commit a5180ddc worked around the problem by emulating it using
> power(2, x) when the numpy version was less than 1.3.0.
> 
> There is no real advantage to using exp2() over power(2, x) (other
> than to save a few keystrokes), but there is a maintenance advantage
> to being as consistent as possible across numpy versions.  So this
> patch changes Piglit to use power(2, x) regardless of the numpy
> version.
> ---
>  generated_tests/builtin_function.py |   10 +++++-----
>  1 files changed, 5 insertions(+), 5 deletions(-)

Yeah, checking for the version and doing different things is ugly.  May
as well just use power(2, x).

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>



More information about the Piglit mailing list