Update contrib.
2 * LIBOIL - Library of Optimized Inner Loops
3 * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
15 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
16 * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
17 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
18 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
19 * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
20 * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
21 * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
22 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
23 * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25 * POSSIBILITY OF SUCH DAMAGE.
28 #ifndef _LIBOIL_TEST_H_
29 #define _LIBOIL_TEST_H_
31 #include <liboil/liboil.h>
32 #include <liboil/liboilutils.h>
33 #include <liboil/liboilprototype.h>
34 #include <liboil/liboilprofile.h>
38 #ifdef OIL_ENABLE_UNSTABLE_API
43 * An opaque structure describing how to test an OilFunctionImpl
44 * for an OilFunctionClass.
48 OilFunctionClass *klass;
49 OilFunctionImpl *impl;
51 OilParameter params[OIL_ARG_LAST];
72 * @test: the @OilTest structure
74 * Typedef for functions that initialize special values
75 * in source arrays for a particular function class.
77 //typedef void (*OilTestFunction) (OilTest *test);
82 * Default number of bytes that are prepended to the array test area.
84 #define OIL_TEST_HEADER 256
88 * Default number of bytes that are appended to the array test area.
90 #define OIL_TEST_FOOTER 256
92 IMPORT_C OilTest *oil_test_new (OilFunctionClass *klass);
93 IMPORT_C void oil_test_free (OilTest *test);
95 IMPORT_C void oil_test_set_iterations (OilTest *test, int iterations);
97 IMPORT_C void oil_test_check_ref (OilTest *test);
98 IMPORT_C int oil_test_check_impl (OilTest *test, OilFunctionImpl *impl);
100 IMPORT_C void oil_test_cleanup (OilTest *test);
101 IMPORT_C void oil_test_init (OilTest *test);
103 IMPORT_C void oil_test_set_test_header (OilTest *test, OilParameter *p, int test_header);
104 IMPORT_C void oil_test_set_test_footer (OilTest *test, OilParameter *p, int test_footer);
106 void _oil_test_marshal_function (void *func, unsigned long *args, int n_args,
107 unsigned int pointer_mask, OilProfile *prof);
109 IMPORT_C void *oil_test_get_source_data (OilTest *test, OilArgType arg_type);
110 IMPORT_C int oil_test_get_arg_pre_n (OilTest *test, OilArgType arg_type);
111 IMPORT_C int oil_test_get_arg_post_n (OilTest *test, OilArgType arg_type);
112 IMPORT_C int oil_test_get_arg_stride (OilTest *test, OilArgType arg_type);
113 IMPORT_C int oil_test_get_value (OilTest *test, OilArgType arg_type);