Changeset 656 for trunk/user/fft
- Timestamp:
- Dec 6, 2019, 12:07:51 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/user/fft/fft.c
r652 r656 177 177 178 178 // array of kernel thread identifiers / indexed by [tid] 179 pthread_t work_trdid[CLUSTERS_MAX * CORES_MAX];179 pthread_t work_trdid[CLUSTERS_MAX * CORES_MAX]; 180 180 181 181 // array of thread attributes / indexed by [tid] 182 pthread_attr_t work_attr[CLUSTERS_MAX * CORES_MAX];182 pthread_attr_t work_attr[CLUSTERS_MAX * CORES_MAX]; 183 183 184 184 // array of work function arguments / indexed by [tid] 185 pthread_parallel_work_args_t work_args[CLUSTERS_MAX * CORES_MAX];185 pthread_parallel_work_args_t work_args[CLUSTERS_MAX * CORES_MAX]; 186 186 187 187 ///////////////////////////////////////////////////////////////////////////////////// … … 189 189 ///////////////////////////////////////////////////////////////////////////////////// 190 190 191 void work( pthread_parallel_work_args_t* args );191 void * work( void * args ); 192 192 193 193 double CheckSum( void ); … … 254 254 // launch the parallel execution, and makes the instrumentation. 255 255 /////////////////////////////////////////////////////////////////// 256 voidmain ( void )256 int main ( void ) 257 257 { 258 258 int error; … … 699 699 exit( 0 ); 700 700 701 return 0; 702 701 703 } // end main() 702 704 … … 704 706 // This function is executed in parallel by all <work> threads. 705 707 ///////////////////////////////////////////////////////////////// 706 void work( pthread_parallel_work_args_t * args )708 void * work( void * arguments ) 707 709 { 708 710 unsigned int tid; // this thread continuous index 709 711 unsigned int lid; // core local index 710 712 unsigned int cid; // cluster continuous index 711 pthread_barrier_t * parent_barrier; // pointer on parent barrier712 713 713 714 unsigned int MyFirst; // index first row allocated to thread … … 723 724 724 725 // get thread arguments 725 tid = args->tid; 726 parent_barrier = args->barrier; 726 pthread_parallel_work_args_t * args = (pthread_parallel_work_args_t *)arguments; 727 728 tid = args->tid; 729 pthread_barrier_t * parent_barrier = args->barrier; 727 730 728 731 // compute lid and cid from tid … … 861 864 // work thread exit 862 865 pthread_exit( NULL ); 866 867 return NULL; 863 868 864 869 } // end work()
Note: See TracChangeset
for help on using the changeset viewer.