379
381
time[0] = (tv2.tv_sec - tv1.tv_sec) * 1000000 + (tv2.tv_usec - tv1.tv_usec);
380
382
#endif /* DICT_HW_MEASURE_TIMINGS */
385
size_t real_ncp = ncp;
385
387
for (icp = 0, ncp = multipass?ncp_block:ncp; icp < real_ncp; icp += ncp, ncp = min2(ncp_block, real_ncp - icp)) {
386
#ifdef DICT_HW_VERBOSE_OUTPUT
387
printf("%i + %i (of %i)\n", icp, ncp, real_ncp);
388
#endif /* DICT_HW_VERBOSE_OUTPUT */
388
#ifndef DICT_HW_MEASURE_TIMINGS
390
printf("Processing control points %i + %i (of %i)\n", icp, ncp, real_ncp);
392
#endif /* ! DICT_HW_MEASURE_TIMINGS */
395
#ifdef DICT_HW_MEASURE_TIMINGS
396
gettimeofday(&tv3, NULL);
397
#endif /* DICT_HW_MEASURE_TIMINGS */
390
398
dictSetActualNumberOfPoints(ps, ncp);
392
400
//dictSetup(ps, ncp, corrsize, precision, flags);
402
#ifdef DICT_HW_MEASURE_TIMINGS
403
gettimeofday(&tv2, NULL);
404
time[6] += (tv2.tv_sec - tv3.tv_sec) * 1000000 + (tv2.tv_usec - tv3.tv_usec);
405
#endif /* DICT_HW_MEASURE_TIMINGS */
408
#ifdef DICT_HW_MEASURE_TIMINGS
409
gettimeofday(&tv3, NULL);
410
#endif /* DICT_HW_MEASURE_TIMINGS */
396
411
dictSetTemplatePoints(ps, x + icp, y + icp);
412
dictSetCurrentPoints(ps, x + icp, y + icp);
413
#ifdef DICT_HW_MEASURE_TIMINGS
414
gettimeofday(&tv2, NULL);
415
time[7] += (tv2.tv_sec - tv3.tv_sec) * 1000000 + (tv2.tv_usec - tv3.tv_usec);
416
#endif /* DICT_HW_MEASURE_TIMINGS */
418
#ifdef DICT_HW_MEASURE_TIMINGS
419
gettimeofday(&tv3, NULL);
420
#endif /* DICT_HW_MEASURE_TIMINGS */
398
421
name = g_strdup_printf("%s/images/%s", argv[optind], images[0]);
399
422
if (!g_file_test(name, G_FILE_TEST_IS_REGULAR)) {
436
#ifdef DICT_HW_MEASURE_TIMINGS
437
gettimeofday(&tv2, NULL);
438
time[8] += (tv2.tv_sec - tv3.tv_sec) * 1000000 + (tv2.tv_usec - tv3.tv_usec);
439
#endif /* DICT_HW_MEASURE_TIMINGS */
414
dictSetCurrentPoints(ps, x + icp, y + icp);
442
#ifdef DICT_HW_MEASURE_TIMINGS
443
gettimeofday(&tv3, NULL);
444
#endif /* DICT_HW_MEASURE_TIMINGS */
417
445
gchar *next = NULL;
419
447
name = g_strdup_printf("%s/images/%s", argv[optind], images[1]);
455
#ifdef DICT_HW_MEASURE_TIMINGS
456
gettimeofday(&tv2, NULL);
457
time[5] += (tv2.tv_sec - tv3.tv_sec) * 1000000 + (tv2.tv_usec - tv3.tv_usec);
458
#endif /* DICT_HW_MEASURE_TIMINGS */
427
460
for (i = 1; i < maximg; i++, name = next) {
428
#ifdef DICT_HW_VERBOSE_OUTPUT
429
# ifndef DICT_HW_MEASURE_TIMINGS
461
#ifndef DICT_HW_MEASURE_TIMINGS
430
462
printf("%s\n", images[i]);
431
# endif /* !DICT_HW_MEASURE_TIMINGS */
432
#endif /* DICT_HW_VERBOSE_OUTPUT */
463
#endif /* !DICT_HW_MEASURE_TIMINGS */
465
#ifdef DICT_HW_MEASURE_TIMINGS
466
gettimeofday(&tv3, NULL);
467
#endif /* DICT_HW_MEASURE_TIMINGS */
434
468
if ((i + 1) < maximg) {
435
469
next = g_strdup_printf("%s/images/%s", argv[optind], images[i + 1]);
436
470
if (!g_file_test(next, G_FILE_TEST_IS_REGULAR)) {
449
#ifdef DICT_HW_MEASURE_TIMINGS
450
gettimeofday(&tv3, NULL);
451
#endif /* DICT_HW_MEASURE_TIMINGS */
452
483
err = dictLoadImageFile(ps, name);
453
484
#ifdef DICT_HW_MEASURE_TIMINGS
454
485
gettimeofday(&tv2, NULL);
529
560
gettimeofday(&tv3, NULL);
530
561
time[3] = (tv3.tv_sec - tv1.tv_sec) * 1000000 + (tv3.tv_usec - tv1.tv_usec);
531
562
time[4] = (tv3.tv_sec - tv2.tv_sec) * 1000000 + (tv3.tv_usec - tv2.tv_usec);
564
time[9] = time[6] + time[7] + time[8];
532
566
reportMessage("");
533
567
reportMessage("Global timings");
534
568
reportMessage("--------------");
535
569
print_timing("Overall", time[3]);
536
print_timing("Initialization", time[0]);
570
print_timing("Initialization", time[0] + time[9]);
571
print_timing("Processing/Full", time[2] - time[9], maximg - 1);
537
572
print_timing("Cleanup", time[4]);
538
print_timing("Processing/Full", time[2], maximg - 1);
539
print_timing("Processing/Computations", time[2] - time[1], maximg - 1);
540
print_timing("Processing/Pushing Data", time[5], maximg - 1);
541
print_timing("Processing/Waiting Result", time[2] - time[1] - time[5], maximg - 1);
573
print_timing("Initialization/Reinit", time[6]);
574
print_timing("Initialization/SetPoints", time[7]);
575
print_timing("Initialization/LoadTemplate", time[8]);
576
print_timing("Processing/Computations", time[2] - time[9] - time[1], maximg - 1);
542
577
print_timing("Processing/Writeout", time[1], maximg - 1);
578
print_timing("Computations/Load Image", time[5], maximg - 1);
579
print_timing("Computations/Waiting Result", time[2] - time[9] - time[1] - time[5], maximg - 1);
543
580
reportMessage("");
544
581
#endif /* DICT_HW_MEASURE_TIMINGS */