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 |
//Portions Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). All rights reserved.
|
sl@0
|
29 |
|
sl@0
|
30 |
#ifndef _LIBOIL_PARAMETER_H_
|
sl@0
|
31 |
#define _LIBOIL_PARAMETER_H_
|
sl@0
|
32 |
|
sl@0
|
33 |
#include <liboil/liboiltypes.h>
|
sl@0
|
34 |
#include <liboil/liboilutils.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 |
* OilType:
|
sl@0
|
42 |
*
|
sl@0
|
43 |
* Enumeration containing the data types understood by Liboil.
|
sl@0
|
44 |
*/
|
sl@0
|
45 |
typedef enum {
|
sl@0
|
46 |
OIL_TYPE_UNKNOWN = 0,
|
sl@0
|
47 |
OIL_TYPE_INT,
|
sl@0
|
48 |
OIL_TYPE_s8,
|
sl@0
|
49 |
OIL_TYPE_u8,
|
sl@0
|
50 |
OIL_TYPE_s16,
|
sl@0
|
51 |
OIL_TYPE_u16,
|
sl@0
|
52 |
OIL_TYPE_s32,
|
sl@0
|
53 |
OIL_TYPE_u32,
|
sl@0
|
54 |
OIL_TYPE_s64,
|
sl@0
|
55 |
OIL_TYPE_u64,
|
sl@0
|
56 |
OIL_TYPE_f32,
|
sl@0
|
57 |
OIL_TYPE_f64,
|
sl@0
|
58 |
OIL_TYPE_s8p,
|
sl@0
|
59 |
OIL_TYPE_u8p,
|
sl@0
|
60 |
OIL_TYPE_s16p,
|
sl@0
|
61 |
OIL_TYPE_u16p,
|
sl@0
|
62 |
OIL_TYPE_s32p,
|
sl@0
|
63 |
OIL_TYPE_u32p,
|
sl@0
|
64 |
OIL_TYPE_s64p,
|
sl@0
|
65 |
OIL_TYPE_u64p,
|
sl@0
|
66 |
OIL_TYPE_f32p,
|
sl@0
|
67 |
OIL_TYPE_f64p,
|
sl@0
|
68 |
} OilType;
|
sl@0
|
69 |
|
sl@0
|
70 |
/**
|
sl@0
|
71 |
* OilArgType:
|
sl@0
|
72 |
*
|
sl@0
|
73 |
* Enumeration containing the types of parameter types understood
|
sl@0
|
74 |
* by Liboil.
|
sl@0
|
75 |
*/
|
sl@0
|
76 |
typedef enum {
|
sl@0
|
77 |
OIL_ARG_UNKNOWN = 0,
|
sl@0
|
78 |
OIL_ARG_N,
|
sl@0
|
79 |
OIL_ARG_M,
|
sl@0
|
80 |
OIL_ARG_DEST1,
|
sl@0
|
81 |
OIL_ARG_DSTR1,
|
sl@0
|
82 |
OIL_ARG_DEST2,
|
sl@0
|
83 |
OIL_ARG_DSTR2,
|
sl@0
|
84 |
OIL_ARG_DEST3,
|
sl@0
|
85 |
OIL_ARG_DSTR3,
|
sl@0
|
86 |
OIL_ARG_SRC1,
|
sl@0
|
87 |
OIL_ARG_SSTR1,
|
sl@0
|
88 |
OIL_ARG_SRC2,
|
sl@0
|
89 |
OIL_ARG_SSTR2,
|
sl@0
|
90 |
OIL_ARG_SRC3,
|
sl@0
|
91 |
OIL_ARG_SSTR3,
|
sl@0
|
92 |
OIL_ARG_SRC4,
|
sl@0
|
93 |
OIL_ARG_SSTR4,
|
sl@0
|
94 |
OIL_ARG_SRC5,
|
sl@0
|
95 |
OIL_ARG_SSTR5,
|
sl@0
|
96 |
OIL_ARG_INPLACE1,
|
sl@0
|
97 |
OIL_ARG_ISTR1,
|
sl@0
|
98 |
OIL_ARG_INPLACE2,
|
sl@0
|
99 |
OIL_ARG_ISTR2,
|
sl@0
|
100 |
|
sl@0
|
101 |
OIL_ARG_LAST
|
sl@0
|
102 |
} OilArgType;
|
sl@0
|
103 |
|
sl@0
|
104 |
/**
|
sl@0
|
105 |
* OilParameter:
|
sl@0
|
106 |
*
|
sl@0
|
107 |
* An opaque structure representing a single parameter in the
|
sl@0
|
108 |
* function prototype of an OilFunctionClass.
|
sl@0
|
109 |
*/
|
sl@0
|
110 |
struct _OilParameter {
|
sl@0
|
111 |
/*< private >*/
|
sl@0
|
112 |
char *type_name;
|
sl@0
|
113 |
char *parameter_name;
|
sl@0
|
114 |
|
sl@0
|
115 |
int order;
|
sl@0
|
116 |
OilType type;
|
sl@0
|
117 |
|
sl@0
|
118 |
int direction;
|
sl@0
|
119 |
int is_pointer;
|
sl@0
|
120 |
int is_stride;
|
sl@0
|
121 |
int index;
|
sl@0
|
122 |
int prestride_length;
|
sl@0
|
123 |
int prestride_var;
|
sl@0
|
124 |
int poststride_length;
|
sl@0
|
125 |
int poststride_var;
|
sl@0
|
126 |
|
sl@0
|
127 |
OilArgType parameter_type;
|
sl@0
|
128 |
|
sl@0
|
129 |
uint8_t *src_data;
|
sl@0
|
130 |
uint8_t *ref_data;
|
sl@0
|
131 |
uint8_t *test_data;
|
sl@0
|
132 |
unsigned long value;
|
sl@0
|
133 |
|
sl@0
|
134 |
int pre_n;
|
sl@0
|
135 |
int post_n;
|
sl@0
|
136 |
int stride;
|
sl@0
|
137 |
int size;
|
sl@0
|
138 |
int guard;
|
sl@0
|
139 |
int test_header;
|
sl@0
|
140 |
int test_footer;
|
sl@0
|
141 |
};
|
sl@0
|
142 |
|
sl@0
|
143 |
#ifdef __SYMBIAN32__
|
sl@0
|
144 |
IMPORT_C
|
sl@0
|
145 |
#endif
|
sl@0
|
146 |
void *oil_param_get_source_data (OilParameter *param);
|
sl@0
|
147 |
|
sl@0
|
148 |
|
sl@0
|
149 |
#ifdef __SYMBIAN32__
|
sl@0
|
150 |
IMPORT_C
|
sl@0
|
151 |
#endif
|
sl@0
|
152 |
int oil_param_from_string (OilParameter *p, char *s);
|
sl@0
|
153 |
|
sl@0
|
154 |
#define oil_type_is_floating_point(type) \
|
sl@0
|
155 |
(((type) == OIL_TYPE_f64p) || ((type) == OIL_TYPE_f32p))
|
sl@0
|
156 |
|
sl@0
|
157 |
#endif
|
sl@0
|
158 |
|
sl@0
|
159 |
OIL_END_DECLS
|
sl@0
|
160 |
|
sl@0
|
161 |
#endif
|
sl@0
|
162 |
|