Changeset 821 for soft/giet_vm/applications/rosenfeld/include/mca.h
- Timestamp:
- May 6, 2016, 3:06:29 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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__
Note: See TracChangeset
for help on using the changeset viewer.