| 444 | } |
| 445 | |
| 446 | void |
| 447 | GpuStatTimer::Print( ) |
| 448 | { |
| 449 | const int tableWidth = 60; |
| 450 | const int tableHalf = tableWidth / 2; |
| 451 | const int tableThird = tableWidth / 3; |
| 452 | const int tableFourth = tableWidth / 4; |
| 453 | const int tableFifth = tableWidth / 5; |
| 454 | |
| 455 | for( cl_uint id = 0; id < labelID.size( ); ++id ) |
| 456 | { |
| 457 | size_t halfString = labelID[ id ].first.size( ) / 2; |
| 458 | |
| 459 | // Print label of timer, in a header |
| 460 | std::cout << std::endl << std::setw( tableHalf + halfString ) << std::setfill( '=' ) << labelID[ id ].first |
| 461 | << std::setw( tableHalf - halfString ) << "=" << std::endl; |
| 462 | tout << std::setfill( _T( ' ' ) ); |
| 463 | |
| 464 | std::vector< StatData > mean = getMean( id ); |
| 465 | |
| 466 | // Print each individual dimension |
| 467 | tstringstream catLengths; |
| 468 | for( cl_uint t = 0; t < mean.size( ); ++t ) |
| 469 | { |
| 470 | cl_double time = 0; |
| 471 | if( mean[ t ].kernel == NULL ) |
| 472 | { |
| 473 | for( cl_uint m = 0; m < t; ++m ) |
| 474 | { |
| 475 | if( mean[ m ].plHandle == mean[ t ].planX || |
| 476 | mean[ m ].plHandle == mean[ t ].planY || |
| 477 | mean[ m ].plHandle == mean[ t ].planZ || |
| 478 | mean[ m ].plHandle == mean[ t ].planTX || |
| 479 | mean[ m ].plHandle == mean[ t ].planTY || |
| 480 | mean[ m ].plHandle == mean[ t ].planTZ || |
| 481 | mean[ m ].plHandle == mean[ t ].planRCcopy || |
| 482 | mean[ m ].plHandle == mean[ t ].planCopy ) |
| 483 | { |
| 484 | time += mean[ m ].doubleNanoSec; |
| 485 | } |
| 486 | } |
| 487 | mean[ t ].doubleNanoSec = time; |
| 488 | } |
| 489 | else |
| 490 | { |
| 491 | time = mean[ t ].doubleNanoSec; |
| 492 | } |
| 493 | double gFlops = mean[ t ].calcFlops( ) / time; |
| 494 | |
| 495 | tout << std::setw( tableFourth ) << _T( "Handle:" ) |
| 496 | << std::setw( tableThird ) << mean[ t ].plHandle << std::endl; |
| 497 | |
| 498 | if( mean[ t ].kernel != 0 ) |
| 499 | { |
| 500 | tout << std::setw( tableFourth ) << _T( "Kernel:" ) |
| 501 | << std::setw( tableThird ) << reinterpret_cast<void*>( mean[ t ].kernel ) << std::endl; |
| 502 | } |
| 503 | |