Changeset 821 for soft/giet_vm/applications/rosenfeld/include
- Timestamp:
- May 6, 2016, 3:06:29 PM (9 years ago)
- Location:
- soft/giet_vm/applications/rosenfeld/include
- Files:
-
- 2 added
- 2 deleted
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/include/ecc_common.h
r772 r821 6 6 #define _ECC_COMMON_H_ 7 7 8 #ifdef __cplusplus 9 #pragma message ("C++") 10 extern "C" { 11 #endif 12 13 //#include <stdio.h> 14 //#include <stdlib.h> 15 //#include <math.h> 16 17 //#include "def.h" 18 //#include "nrc.h" 19 //#include "util.h" 20 //#include "palette.h" 8 #include <stdbool.h> 21 9 22 10 // ------------------------------------------ 23 11 // -- valeur des parametres des benchmarks -- 24 12 // ------------------------------------------ 25 //#define ENABLE_GLOBAL_PARAM 26 //#ifdef ENABLE_GLOBAL_PARAM 13 27 14 #define ECC_G0 1 28 15 #define ECC_G1 16 … … 207 194 uint32 mt19937_uint32(uint32 a, uint32 b); 208 195 209 BOOLstrto_Bool(char *str);196 bool strto_Bool(char *str); 210 197 211 198 void check_no_write(uint32 **T, int i0, int i1, int j0, int j1); -
soft/giet_vm/applications/rosenfeld/include/ecc_features.h
r772 r821 16 16 #define __ECC_FEATURES_H__ 17 17 18 #ifdef __cplusplus 19 extern "C" { 20 #endif 21 22 #ifdef VERBOSE_PRAGMA 23 //#pragma message("- include ecc_features.h") 24 #endif 25 26 #define REGION_STATS1 27 28 //#define REGION_STATS2 29 //#define REGION_STATS3 30 //#define REGION_STATS4 31 32 #define Warning 33 #define Error 18 #if PARMERGE 19 #include <pthread.h> 20 #endif 21 34 22 35 23 // ------------------------------------------------------------------------ … … 46 34 uint32 S; 47 35 48 uint16 x; // abscisse du centre d'inertie x = Sx / S49 uint16 y; // ordonnee du centre d'inertie y = Sy / S50 51 36 uint32 Sx; 52 37 uint32 Sy; 53 54 #ifdef REGION_STATS2 55 //uint64 Sx2; 56 //uint64 Sxy; 57 //uint64 Sy2; 58 59 //uint32 Mx2; 60 //uint32 Mxy; 61 //uint32 My2; 62 63 double teta; // direction principale 64 #endif 65 66 #ifdef REGION_STATS3 67 //uint64 Sx3; 68 //uint64 Sx2y; 69 //uint64 Sxy2; 70 //uint64 Sy3; 71 72 //uint64 Mx3; 73 //uint64 Mx2y; 74 //uint64 Mxy2; 75 //uint64 My3; 76 #endif 38 #if PARMERGE 39 pthread_spinlock_t lock; 40 #endif 41 77 42 } RegionStats; 78 43 … … 112 77 */ 113 78 79 80 114 81 /* ------------------------------ */ 115 82 /* --- RegionStats after 2009 --- */ … … 118 85 119 86 RegionStats* RegionStatsVector (int i0, int i1); 87 #if TARGET_OS == GIETVM 88 RegionStats * remote_RegionStatsVector (int i0, int i1, int x, int y); 89 #endif 120 90 RegionStats* RegionStatsVector0 (int i0, int i1); 121 91 void free_RegionStatsVector (RegionStats *v, int i0, int i1); … … 219 189 220 190 void RegionStats_Save_Stats1_Sparse(RegionStats *Stats, uint32 *EQ, uint32 ne0, uint32 ne1, char *filename); 221 void RegionStats_DisplayStats_Sparse(uint32 *EQ, uint32 ne0, uint32 ne1, RegionStats *Stats, char *name );191 void RegionStats_DisplayStats_Sparse(uint32 *EQ, uint32 ne0, uint32 ne1, RegionStats *Stats, char *name, int * start_index); 222 192 // affichage des Stats pour les etiquettes roots/ancetres de leur composante (pour algo Suzuki) 223 193 … … 235 205 void sortv_ui32matrix_col(uint32 **m, int i0, int i1, int j0, int j1, int col); 236 206 void RegionStats_SortFeatures(RegionStats *Stats, uint32 nemax); 237 238 // version paralleles avec OpenMP2 ou OpenMP4 239 void imageFeaturesComputation_omp0(uint32 **E, int height, int width, RegionStats *Stats); // wrong 240 void imageFeaturesComputation_omp2(uint32 **E, int height, int width, RegionStats *Stats); // OpenMP 2.0 critical 241 void imageFeaturesComputation_omp3(uint32 **E, int height, int width, RegionStats *Stats); // OpenMP 2.0 critical + atomic 242 void imageFeaturesComputation_omp4(uint32 **E, int height, int width, RegionStats *Stats); // OpenMP 3.0 task + OpenMP 4.0 depend 243 void imageFeaturesComputation_omp5(uint32 **E, int height, int width, uint16* Xmin, uint16* Xmax, uint16* Ymin, uint16* Ymax, uint32* S, uint32* Sx, uint32* Sy); 244 207 245 208 int RegionStats_Compare(RegionStats *S1, RegionStats *S2); 246 209 int RegionStatsVector_Compare(RegionStats *S1, int i0, int i1, RegionStats *S2); -
soft/giet_vm/applications/rosenfeld/include/mca.h
r805 r821 14 14 #define __MCA_H__ 15 15 16 #include <user_lock.h> 16 #include "ecc_features.h" 17 18 #include "nrc_os_config.h" 19 20 #if TARGET_OS == GIETVM 21 #include <user_lock.h> 22 #include <user_barrier.h> 23 #elif TARGET_OS == LINUX 24 #include <pthread.h> 25 #endif 17 26 18 27 19 #ifdef __cplusplus 20 #ifdef VERBOSE_PRAGMA 21 #pragma message ("C++") 22 #endif 23 extern "C" { 24 #endif 28 // QM : using mutex lock instead of mutexlock, 29 // because apparently mutexlocks cause a bug in valgrind 30 // (solved but the installed version is not recent enough) 31 // cf. https://bugs.kde.org/show_bug.cgi?id=336435 32 pthread_mutex_t print_lock; 25 33 26 user_lock_t print_lock; 27 28 #define MCA_VERBOSE0(X) ({ \ 29 lock_acquire(&print_lock); \ 30 X; \ 31 lock_release(&print_lock); \ 34 #define MCA_VERBOSE0(X) ({ \ 35 pthread_mutex_lock(&print_lock); \ 36 X; \ 37 pthread_mutex_unlock(&print_lock); \ 32 38 }) 33 #define MCA_VERBOSE1(X) ({ \ 34 lock_acquire(&print_lock); \ 35 X; \ 36 lock_release(&print_lock); \ 39 #define MCA_VERBOSE1(X) ({ \ 40 pthread_mutex_lock(&print_lock); \ 41 X; \ 42 pthread_mutex_unlock(&print_lock); \ 43 }) 44 #define MCA_DISPLAY0(X) ({ \ 45 pthread_mutex_lock(&print_lock); \ 46 X; \ 47 pthread_mutex_unlock(&print_lock); \ 48 }) 49 #define MCA_DISPLAY1(X) ({ \ 50 pthread_mutex_lock(&print_lock); \ 51 X; \ 52 pthread_mutex_unlock(&print_lock); \ 37 53 }) 38 54 39 55 40 //#define MCA_VERBOSE2(X) X 41 #define MCA_VERBOSE2(X) 56 #define MCA_VERBOSE2(X) 57 /* 58 #define MCA_VERBOSE2(X) ({ \ 59 pthread_mutex_lock(&print_lock); \ 60 X; \ 61 pthread_mutex_unlock(&print_lock); \ 62 }) 63 */ 64 65 #define MCA_DISPLAY2(X) 42 66 43 67 … … 56 80 57 81 uint32 e0, e1; // indice pour chaque bande 58 uint32 ne; // indice max d'etiquettes utilise par bande82 uint32 ne; // indice max d'etiquettes utilise par bande 59 83 60 int alpha; // puissance de 2 >= a la taille d'un bloc 61 //uint32 *I; 62 uint32 *T; // table d'quivalence table (Rosenfeld) ou d'indices (Warp) 63 uint32 **D; // distributed table (instanciee dans chaque worker) 84 int alpha; // puissance de 2 >= a la taille d'un bloc 85 uint32 * T; // table d'quivalence table (Rosenfeld) ou d'indices (Warp) 86 uint32 ** D; // distributed table (instanciee dans chaque worker) 64 87 65 //RegionStats *Stats; 88 RegionStats * stats; 89 RegionStats ** F; 66 90 67 91 struct sMCA * mca; // pointeur vers le maitre (pour les esclaves) 68 92 struct sMCA ** mcas; // tableau de pointeurs vers les workers 93 94 // For pyramidal barriers 95 int nb_level; 96 pthread_barrier_t * barriers; 69 97 } MCA; 70 98 71 99 void MCA_Error(char * msg); 72 100 … … 77 105 void MCA_Set_ImageL(MCA * mca, uint32 ** E); 78 106 79 void 80 void 107 void MCA_Set_Size(MCA * mca, int width, int height); 108 void MCA_Set_NP(MCA * mca, int np); 81 109 82 110 uint32 MCA_CalcMaxLabels(int connection, uint32 height, uint32 width); … … 99 127 void MCA_Warp(MCA * mca); 100 128 101 #ifdef __cplusplus102 }103 #endif104 129 105 130 #endif // __MCA_H__ -
soft/giet_vm/applications/rosenfeld/include/mca_matrix_dist.h
r805 r821 13 13 uint32 ** dist_ui32matrix(int i0, int i1, int j0, int j1); 14 14 void free_dist_ui32matrix(uint32 ** m, int i0, int i1, int j0, int j1); 15 #if TARGET_OS == GIETVM 16 uint32 ** remote_dist_ui32matrix(int i0, int i1, int j0, int j1, int x, int y); 17 #endif 15 18 16 19 #ifdef __cplusplus -
soft/giet_vm/applications/rosenfeld/include/mca_rosenfeld.h
r805 r821 16 16 #include "mca.h" 17 17 18 #ifdef __cplusplus19 #ifdef VERBOSE_PRAGMA20 #pragma message ("C++")21 #endif22 extern "C" {23 #endif24 25 18 uint32 line0Labeling_Rosenfeld (uint8 ** X, int i, int width, uint32 ** E, uint32 * T, uint32 ne); 26 19 uint32 lineLabeling_DT_Rosenfeld(uint8 ** X, int i, int width, uint32 ** E, uint32 * T, uint32 ne); … … 29 22 void solveTable_Range_Rosenfeld(uint32 * T, uint32 e0, uint32 e1); 30 23 31 void MCA_Label_Rosenfeld(MCA * mca); 24 void * MCA_Label_Rosenfeld(void * arg); 25 void * MCA_Label_Features_Rosenfeld(void * arg); 32 26 33 #ifdef __cplusplus34 }35 #endif36 37 27 #endif // __MCA_ROSENFELD_H__ 38 28
Note: See TracChangeset
for help on using the changeset viewer.