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