Changeset 823 for soft/giet_vm/applications/rosenfeld/src-par/mca_main.c
- Timestamp:
- Jun 14, 2016, 5:23:56 PM (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/applications/rosenfeld/src-par/mca_main.c
r822 r823 43 43 #define MAX_THREADS 256 44 44 #define DEFAULT_NTHREADS 1 45 #define DEFAULT_NRUNS 1 45 46 #define DEFAULT_IN_FILENAME "/misc/cadastre.pgm" 46 47 #define DEFAULT_OUT_FILENAME "out.bmp" … … 233 234 234 235 235 // ----------------------------------------------------------- 236 void mca_test2(int num_threads, char * infile, char * outfile)237 // ----------------------------------------------------------- 236 // ------------------------------------------------------------------------- 237 void mca_test2(int num_threads, int num_runs, char * infile, char * outfile) 238 // ------------------------------------------------------------------------- 238 239 { 239 240 int i0, i1, j0, j1; … … 277 278 MCA_Set_ImageL(mca, E); 278 279 MCA_Set_NP(mca, num_threads); 280 MCA_Set_NR(mca, num_runs); 279 281 280 282 // -- MCA init … … 316 318 317 319 318 // -------------------------------------------------------------- 319 int main_test_mca(int num_threads, char * infile, char * outfile)320 // -------------------------------------------------------------- 320 // ---------------------------------------------------------------------------- 321 int main_test_mca(int num_threads, int num_runs, char * infile, char * outfile) 322 // ---------------------------------------------------------------------------- 321 323 { 322 324 CLOCK_INIT(num_threads, 4); // 4 = Number of steps in body 323 325 CLOCK_APP_START; 324 326 325 mca_test2(num_threads, infile, outfile);327 mca_test2(num_threads, num_runs, infile, outfile); 326 328 327 329 CLOCK_APP_END; … … 349 351 int ch; 350 352 int num_threads = DEFAULT_NTHREADS; 353 int num_runs = DEFAULT_NRUNS; 351 354 352 355 MCA_VERBOSE1(printf("*** Starting application Rosenfeld ***\n")); 353 356 354 357 #if TARGET_OS != GIETVM // @QM I think the giet has some random (uninitialized) values for argc and argv 355 while ((ch = getopt(argc, argv, "i:o:n: hdg")) != EOF) {358 while ((ch = getopt(argc, argv, "i:o:n:r:hdg")) != EOF) { 356 359 switch (ch) { 357 360 case 'i': … … 363 366 case 'n': 364 367 num_threads = atoi(optarg); 368 break; 369 case 'r': 370 num_runs = atoi(optarg); 365 371 break; 366 372 case 'h': … … 409 415 MCA_VERBOSE1(printf("Parameters:\n")); 410 416 MCA_VERBOSE1(printf("- Number of threads: %d\n", num_threads)); 417 MCA_VERBOSE1(printf("- Number of images processed: %d\n", num_runs)); 411 418 MCA_VERBOSE1(printf("- Input file: %s\n", infile)); 412 419 MCA_VERBOSE1(printf("- Output file: %s\n", outfile)); … … 450 457 451 458 pthread_mutex_init(&print_lock, PTHREAD_PROCESS_PRIVATE); 452 main_test_mca(num_threads, infile, outfile);459 main_test_mca(num_threads, num_runs, infile, outfile); 453 460 454 461 return 0;
Note: See TracChangeset
for help on using the changeset viewer.