sl@0
|
1 |
/*
|
sl@0
|
2 |
* LIBOIL - Library of Optimized Inner Loops
|
sl@0
|
3 |
* Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
|
sl@0
|
4 |
* All rights reserved.
|
sl@0
|
5 |
*
|
sl@0
|
6 |
* Redistribution and use in source and binary forms, with or without
|
sl@0
|
7 |
* modification, are permitted provided that the following conditions
|
sl@0
|
8 |
* are met:
|
sl@0
|
9 |
* 1. Redistributions of source code must retain the above copyright
|
sl@0
|
10 |
* notice, this list of conditions and the following disclaimer.
|
sl@0
|
11 |
* 2. Redistributions in binary form must reproduce the above copyright
|
sl@0
|
12 |
* notice, this list of conditions and the following disclaimer in the
|
sl@0
|
13 |
* documentation and/or other materials provided with the distribution.
|
sl@0
|
14 |
*
|
sl@0
|
15 |
* THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
|
sl@0
|
16 |
* IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
sl@0
|
17 |
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
|
sl@0
|
18 |
* ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
|
sl@0
|
19 |
* INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
sl@0
|
20 |
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
sl@0
|
21 |
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
|
sl@0
|
22 |
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
|
sl@0
|
23 |
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
|
sl@0
|
24 |
* IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
sl@0
|
25 |
* POSSIBILITY OF SUCH DAMAGE.
|
sl@0
|
26 |
*/
|
sl@0
|
27 |
|
sl@0
|
28 |
#ifndef _LIBOIL_TEST_H_
|
sl@0
|
29 |
#define _LIBOIL_TEST_H_
|
sl@0
|
30 |
|
sl@0
|
31 |
#include <liboil/liboil.h>
|
sl@0
|
32 |
#include <liboil/liboilutils.h>
|
sl@0
|
33 |
#include <liboil/liboilprototype.h>
|
sl@0
|
34 |
#include <liboil/liboilprofile.h>
|
sl@0
|
35 |
|
sl@0
|
36 |
OIL_BEGIN_DECLS
|
sl@0
|
37 |
|
sl@0
|
38 |
#ifdef OIL_ENABLE_UNSTABLE_API
|
sl@0
|
39 |
|
sl@0
|
40 |
/**
|
sl@0
|
41 |
* OilTest:
|
sl@0
|
42 |
*
|
sl@0
|
43 |
* An opaque structure describing how to test an OilFunctionImpl
|
sl@0
|
44 |
* for an OilFunctionClass.
|
sl@0
|
45 |
*/
|
sl@0
|
46 |
struct _OilTest {
|
sl@0
|
47 |
/*< private >*/
|
sl@0
|
48 |
OilFunctionClass *klass;
|
sl@0
|
49 |
OilFunctionImpl *impl;
|
sl@0
|
50 |
OilPrototype *proto;
|
sl@0
|
51 |
OilParameter params[OIL_ARG_LAST];
|
sl@0
|
52 |
OilProfile prof;
|
sl@0
|
53 |
|
sl@0
|
54 |
int iterations;
|
sl@0
|
55 |
int n;
|
sl@0
|
56 |
int m;
|
sl@0
|
57 |
|
sl@0
|
58 |
int inited;
|
sl@0
|
59 |
int tested_ref;
|
sl@0
|
60 |
|
sl@0
|
61 |
double sum_abs_diff;
|
sl@0
|
62 |
int n_points;
|
sl@0
|
63 |
|
sl@0
|
64 |
double profile_ave;
|
sl@0
|
65 |
double profile_std;
|
sl@0
|
66 |
|
sl@0
|
67 |
double tolerance;
|
sl@0
|
68 |
};
|
sl@0
|
69 |
|
sl@0
|
70 |
/**
|
sl@0
|
71 |
* OilTestFunction:
|
sl@0
|
72 |
* @test: the @OilTest structure
|
sl@0
|
73 |
*
|
sl@0
|
74 |
* Typedef for functions that initialize special values
|
sl@0
|
75 |
* in source arrays for a particular function class.
|
sl@0
|
76 |
*/
|
sl@0
|
77 |
//typedef void (*OilTestFunction) (OilTest *test);
|
sl@0
|
78 |
|
sl@0
|
79 |
/**
|
sl@0
|
80 |
* OIL_TEST_HEADER:
|
sl@0
|
81 |
*
|
sl@0
|
82 |
* Default number of bytes that are prepended to the array test area.
|
sl@0
|
83 |
*/
|
sl@0
|
84 |
#define OIL_TEST_HEADER 256
|
sl@0
|
85 |
/**
|
sl@0
|
86 |
* OIL_TEST_FOOTER:
|
sl@0
|
87 |
*
|
sl@0
|
88 |
* Default number of bytes that are appended to the array test area.
|
sl@0
|
89 |
*/
|
sl@0
|
90 |
#define OIL_TEST_FOOTER 256
|
sl@0
|
91 |
|
sl@0
|
92 |
IMPORT_C OilTest *oil_test_new (OilFunctionClass *klass);
|
sl@0
|
93 |
IMPORT_C void oil_test_free (OilTest *test);
|
sl@0
|
94 |
|
sl@0
|
95 |
IMPORT_C void oil_test_set_iterations (OilTest *test, int iterations);
|
sl@0
|
96 |
|
sl@0
|
97 |
IMPORT_C void oil_test_check_ref (OilTest *test);
|
sl@0
|
98 |
IMPORT_C int oil_test_check_impl (OilTest *test, OilFunctionImpl *impl);
|
sl@0
|
99 |
|
sl@0
|
100 |
IMPORT_C void oil_test_cleanup (OilTest *test);
|
sl@0
|
101 |
IMPORT_C void oil_test_init (OilTest *test);
|
sl@0
|
102 |
|
sl@0
|
103 |
IMPORT_C void oil_test_set_test_header (OilTest *test, OilParameter *p, int test_header);
|
sl@0
|
104 |
IMPORT_C void oil_test_set_test_footer (OilTest *test, OilParameter *p, int test_footer);
|
sl@0
|
105 |
|
sl@0
|
106 |
void _oil_test_marshal_function (void *func, unsigned long *args, int n_args,
|
sl@0
|
107 |
unsigned int pointer_mask, OilProfile *prof);
|
sl@0
|
108 |
|
sl@0
|
109 |
IMPORT_C void *oil_test_get_source_data (OilTest *test, OilArgType arg_type);
|
sl@0
|
110 |
IMPORT_C int oil_test_get_arg_pre_n (OilTest *test, OilArgType arg_type);
|
sl@0
|
111 |
IMPORT_C int oil_test_get_arg_post_n (OilTest *test, OilArgType arg_type);
|
sl@0
|
112 |
IMPORT_C int oil_test_get_arg_stride (OilTest *test, OilArgType arg_type);
|
sl@0
|
113 |
IMPORT_C int oil_test_get_value (OilTest *test, OilArgType arg_type);
|
sl@0
|
114 |
|
sl@0
|
115 |
#endif
|
sl@0
|
116 |
|
sl@0
|
117 |
OIL_END_DECLS
|
sl@0
|
118 |
|
sl@0
|
119 |
#endif
|
sl@0
|
120 |
|