diff options
author | José Fonseca <jfonseca@vmware.com> | 2009-08-21 07:34:15 +0100 |
---|---|---|
committer | José Fonseca <jfonseca@vmware.com> | 2009-08-29 09:21:37 +0100 |
commit | 33ce51bc0d52dcfbfa481211dd1fe73a5ecb948f (patch) | |
tree | 265dc567e34ee4336481b39a1fd8d438464be41c /src/gallium/drivers/llvmpipe/lp_test_conv.c | |
parent | d07b0383660cd318ba43abad11bb80de4a124951 (diff) |
llvmpipe: Several fixes of the conversion test.
Diffstat (limited to 'src/gallium/drivers/llvmpipe/lp_test_conv.c')
-rw-r--r-- | src/gallium/drivers/llvmpipe/lp_test_conv.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/gallium/drivers/llvmpipe/lp_test_conv.c b/src/gallium/drivers/llvmpipe/lp_test_conv.c index 91815509b7..e8b0b56d96 100644 --- a/src/gallium/drivers/llvmpipe/lp_test_conv.c +++ b/src/gallium/drivers/llvmpipe/lp_test_conv.c @@ -35,6 +35,7 @@ #include "lp_bld_type.h" +#include "lp_bld_const.h" #include "lp_bld_conv.h" #include "lp_bld_debug.h" #include "lp_test.h" @@ -160,6 +161,7 @@ test_one(unsigned verbose, double cycles_avg = 0.0; unsigned num_srcs; unsigned num_dsts; + double eps; unsigned i, j; if(verbose >= 1) @@ -179,6 +181,8 @@ test_one(unsigned verbose, /* We must not loose or gain channels. Only precision */ assert(src_type.length * num_srcs == dst_type.length * num_dsts); + eps = MAX2(lp_const_eps(src_type), lp_const_eps(dst_type)); + module = LLVMModuleCreateWithName("test"); func = add_conv_test(module, src_type, num_srcs, dst_type, num_dsts); @@ -248,7 +252,7 @@ test_one(unsigned verbose, cycles[i] = end_counter - start_counter; for(j = 0; j < num_dsts; ++j) { - if(!compare_vec(dst_type, dst + j*dst_stride, ref + j*dst_stride)) + if(!compare_vec_with_eps(dst_type, dst + j*dst_stride, ref + j*dst_stride, eps)) success = FALSE; } @@ -263,8 +267,8 @@ test_one(unsigned verbose, fprintf(stderr, "\n"); } -#if 0 - fprintf(stderr, " Ref: ", j); +#if 1 + fprintf(stderr, " Ref: "); for(j = 0; j < src_type.length*num_srcs; ++j) fprintf(stderr, " %f", fref[j]); fprintf(stderr, "\n"); |