Ignore:
Timestamp:
May 6, 2016, 3:06:29 PM (8 years ago)
Author:
meunier
Message:
  • Added several versions of rosenfeld: { SLOW, FAST } x { FEATURES, NO_FEATURES }
  • Added native linux compilation support
  • Added a script to check results natively
  • Started to refactor nrc code
File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/applications/rosenfeld/nrc2/include/nralloc1.h

    r772 r821  
    1111#define __NRALLOC1_H__
    1212
    13 #ifdef __cplusplus
    14 #pragma message ("C++")
    15 extern "C" {
    16 #endif
    17    
    18 #ifdef VERBOSE_PRAGMA
    19 //#pragma message ("- *** include nralloc1.h ***")
    20 #endif
     13#include <stdint.h>
    2114
    22 
    23 //NR_END est maintenant defini dans nrutil.h
    24 
    25 #define NR_END 0
    26 #define FREE_ARG char*
    27 
    28 //long nr_end = NR_END;
    29 
    30 //void nrerror(char error_text[]);
    31 //void nrerror(char *format, ...);
    32 //void Error  (char *format, ...);
    33 //void Warning(char *format, ...);
     15#include "nrc_os_config.h"
     16#include "nrtype.h"
    3417
    3518/*
     
    3922 */
    4023
    41 // do: allocate a float vector with subscript range v[nl..nh]
     24#define type_vector(t) \
     25t * short_name(t,,vector)(int32_t nl, int32_t nh)
    4226
    43 //IMAGE_EXPORT(byte*)      bvector(long nl, long nh);
    44 IMAGE_EXPORT(sint8*)   si8vector(long nl, long nh);
    45 IMAGE_EXPORT(uint8*)   ui8vector(long nl, long nh);
    46 IMAGE_EXPORT(sint16*) si16vector(long nl, long nh);
    47 IMAGE_EXPORT(uint16*) ui16vector(long nl, long nh);
    48 IMAGE_EXPORT(sint32*) si32vector(long nl, long nh);
    49 IMAGE_EXPORT(uint32*) ui32vector(long nl, long nh);
    50 IMAGE_EXPORT(sint64*) si64vector(long nl, long nh);
    51 IMAGE_EXPORT(uint64*) ui64vector(long nl, long nh);
     27type_vector(int8_t);
     28type_vector(uint8_t);
     29type_vector(int16_t);
     30type_vector(uint16_t);
     31type_vector(int32_t);
     32type_vector(uint32_t);
     33type_vector(int64_t);
     34type_vector(uint64_t);
     35type_vector(float);
     36type_vector(double);
     37type_vector(rgb8);
     38type_vector(rgbx8);
     39type_vector(rgb32);
     40type_vector(void_p);
    5241
    53 IMAGE_EXPORT(float32*) f32vector(long nl, long nh);
    54 IMAGE_EXPORT(float64*) f64vector(long nl, long nh);
    5542
    56 IMAGE_EXPORT(rgb8*)   rgb8vector(long nl, long nh);
    57 IMAGE_EXPORT(rgbx8*) rgbx8vector(long nl, long nh);
    58 IMAGE_EXPORT(rgb32*) rgb32vector(long nl, long nh);
    5943
    60 IMAGE_EXPORT(void**)     vvector(long nl, long nh);
     44#if TARGET_OS == GIETVM
     45#define remote_type_vector(t) \
     46t * short_name(t,remote_,vector)(int32_t nl, int32_t nh, int32_t x, int32_t y)
     47
     48remote_type_vector(int8_t);
     49remote_type_vector(uint8_t);
     50remote_type_vector(int16_t);
     51remote_type_vector(uint16_t);
     52remote_type_vector(int32_t);
     53remote_type_vector(uint32_t);
     54remote_type_vector(int64_t);
     55remote_type_vector(uint64_t);
     56remote_type_vector(float);
     57remote_type_vector(double);
     58remote_type_vector(rgb8);
     59remote_type_vector(rgbx8);
     60remote_type_vector(rgb32);
     61remote_type_vector(void_p);
     62
     63//void ** remote_vvector(long nl, long nh, int x, int y);
     64#endif
     65
     66#define type_vector0(t) \
     67t * short_name(t,,vector0)(int32_t nl, int32_t nh)
     68
     69type_vector0(int8_t);
     70type_vector0(uint8_t);
     71type_vector0(int16_t);
     72type_vector0(uint16_t);
     73type_vector0(int32_t);
     74type_vector0(uint32_t);
     75type_vector0(int64_t);
     76type_vector0(uint64_t);
     77type_vector0(float);
     78type_vector0(double);
     79type_vector0(rgb8);
     80type_vector0(rgbx8);
     81type_vector0(rgb32);
     82type_vector0(void_p);
     83
     84#define realloc_type_vector(t) \
     85t * short_name(t,realloc_,vector)(t * v, int32_t nl, int32_t nh)
     86
     87realloc_type_vector(int8_t);
     88realloc_type_vector(uint8_t);
     89realloc_type_vector(int16_t);
     90realloc_type_vector(uint16_t);
     91realloc_type_vector(int32_t);
     92realloc_type_vector(uint32_t);
     93realloc_type_vector(int64_t);
     94realloc_type_vector(uint64_t);
     95realloc_type_vector(float);
     96realloc_type_vector(double);
     97realloc_type_vector(rgb8);
     98realloc_type_vector(rgbx8);
     99realloc_type_vector(rgb32);
     100realloc_type_vector(void_p);
     101
     102
     103#define free_type_vector(t) \
     104void short_name(t,free_,vector)(t * v, long nl, long nh)
     105
     106free_type_vector(int8_t);
     107free_type_vector(uint8_t);
     108free_type_vector(int16_t);
     109free_type_vector(uint16_t);
     110free_type_vector(int32_t);
     111free_type_vector(uint32_t);
     112free_type_vector(int64_t);
     113free_type_vector(uint64_t);
     114free_type_vector(float);
     115free_type_vector(double);
     116free_type_vector(rgb8);
     117free_type_vector(rgbx8);
     118free_type_vector(rgb32);
     119free_type_vector(void_p);
     120
     121
    61122
    62123/*
    63  * ---------------
    64  * --- vector0 ---
    65  * ---------------
    66  */
    67 
    68 // do: allocate a vector and set it to 0
    69 
    70 //IMAGE_EXPORT(byte*)       bvector0(long nl, long nh);
    71 IMAGE_EXPORT(sint8*)    si8vector0(long nl, long nh);
    72 IMAGE_EXPORT(uint8*)    ui8vector0(long nl, long nh);
    73 IMAGE_EXPORT(sint16*)  si16vector0(long nl, long nh);
    74 IMAGE_EXPORT(uint16*)  ui16vector0(long nl, long nh);
    75 IMAGE_EXPORT(sint32*)  si32vector0(long nl, long nh);
    76 IMAGE_EXPORT(uint32*)  ui32vector0(long nl, long nh);
    77 
    78 IMAGE_EXPORT(float32*) f32vector0(long nl, long nh);
    79 IMAGE_EXPORT(float64*) f64vector0(long nl, long nh);
    80 
    81 IMAGE_EXPORT(rgb8*)   rgb8vector0(long nl, long nh);
    82 IMAGE_EXPORT(rgbx8*) rgbx8vector0(long nl, long nh);
    83 IMAGE_EXPORT(rgb32*) rgb32vector0(long nl, long nh);
    84 
    85 IMAGE_EXPORT(void**)     vvector0(long nl, long nh);
    86 /*
    87  * ----------------------
    88  * --- realloc_vector ---
    89  * ----------------------
    90  */
    91 
    92 // realloc a vector to [nl..nh]
    93 IMAGE_EXPORT(void**)  realloc_vvector(void   **v, long nl, long nh);
    94 
    95 /*
    96  * -------------------
    97  * --- free_vector ---
    98  * -------------------
    99  */
    100 
    101 //IMAGE_EXPORT(void) free_bvector    (byte    *v, long nl, long nh);
    102 IMAGE_EXPORT(void) free_si8vector  (sint8   *v, long nl, long nh);
    103 IMAGE_EXPORT(void) free_ui8vector  (uint8   *v, long nl, long nh);
    104 IMAGE_EXPORT(void) free_si16vector (sint16  *v, long nl, long nh);
    105 IMAGE_EXPORT(void) free_ui16vector (uint16  *v, long nl, long nh);
    106 IMAGE_EXPORT(void) free_si32vector (sint32  *v, long nl, long nh);
    107 IMAGE_EXPORT(void) free_ui32vector (uint32  *v, long nl, long nh);
    108 IMAGE_EXPORT(void) free_si64vector (sint64  *v, long nl, long nh);
    109 IMAGE_EXPORT(void) free_ui64vector (uint64  *v, long nl, long nh);
    110 
    111 IMAGE_EXPORT(void) free_f32vector  (float32 *v, long nl, long nh);
    112 IMAGE_EXPORT(void) free_f64vector  (float64 *v, long nl, long nh);
    113 
    114 IMAGE_EXPORT(void) free_rgb8vector (rgb8    *v, long nl, long nh);
    115 IMAGE_EXPORT(void) free_rgbx8vector(rgbx8   *v, long nl, long nh);
    116 IMAGE_EXPORT(void) free_rgb32vector(rgb32   *v, long nl, long nh);
    117 
    118 IMAGE_EXPORT(void) free_vvector    (void   **v, long nl, long nh);
    119 
    120 #ifdef __cplusplus
    121 }
    122 #endif
     124void ** vvector(long nl, long nh);
     125void ** vvector0(long nl, long nh);
     126void ** realloc_vvector(void ** v, long nl, long nh);
     127void free_vvector(void ** v, long nl, long nh);
     128*/
    123129
    124130#endif /* __NRALLOC1_H__ */
     131
Note: See TracChangeset for help on using the changeset viewer.