| 1473 | } |
| 1474 | |
| 1475 | VerifyApplication::TestReturnValue run(VerifyApplication* state, bool silent) |
| 1476 | { |
| 1477 | VerifyApplication::TestReturnValue ret = VerifyApplication::PASSED; |
| 1478 | |
| 1479 | size_t maxN = 0; |
| 1480 | switch (gtype) { |
| 1481 | case LINE_GEOMETRY: |
| 1482 | case LINE_GEOMETRY_MB: |
| 1483 | case BEZIER_GEOMETRY: |
| 1484 | case BEZIER_GEOMETRY_MB: |
| 1485 | case BSPLINE_GEOMETRY: |
| 1486 | case BSPLINE_GEOMETRY_MB: |
| 1487 | case CATMULL_GEOMETRY: |
| 1488 | case CATMULL_GEOMETRY_MB: maxN = 250000; break; |
| 1489 | default: maxN = 1000000; break; |
| 1490 | } |
| 1491 | |
| 1492 | for (size_t N=128; N<maxN; N = (size_t)((float)N * 1.5f)) |
| 1493 | { |
| 1494 | auto bytes_one_thread = run_build(state,N,1); |
| 1495 | auto bytes_all_threads = run_build(state,N,0); |
| 1496 | double bytes_expected = expected_size(state,bytes_one_thread.first); |
| 1497 | double expected_to_single = double(bytes_one_thread.second)/double(bytes_expected); |
| 1498 | double single_to_threaded = double(bytes_all_threads.second)/double(bytes_one_thread.second); |
| 1499 | |
| 1500 | const bool failed0 = expected_to_single > 1.0f; |
| 1501 | const bool failed1 = (sflags.qflags == RTC_BUILD_QUALITY_LOW) ? single_to_threaded > 1.35f : single_to_threaded > 1.12f; |
| 1502 | |
| 1503 | if (failed0 || failed1) { |
| 1504 | std::cout << state->red ("-") << std::flush; |
| 1505 | ret = VerifyApplication::FAILED; |
| 1506 | } else { |
| 1507 | std::cout << state->green ("+") << std::flush; |
| 1508 | } |
| 1509 | |
| 1510 | if (failed0 || failed1) |
| 1511 | { |
| 1512 | double num_primitives = (double)bytes_one_thread.first; |
| 1513 | std::cout << "N = " << num_primitives << ", n = " << ceilf(sqrtf(N/4.0f)) << ", " |
| 1514 | "expected = " << bytes_expected/num_primitives << " B, " << |
| 1515 | "1 thread = " << bytes_one_thread.second/num_primitives << " B (" << 100.0f*expected_to_single << " %)" << (failed0 ? state->red(" [FAILED]") : "") << ", " << |
| 1516 | "all_threads = " << bytes_all_threads.second/num_primitives << " B (" << 100.0f*single_to_threaded << " %)" << (failed1 ? state->red(" [FAILED]") : "") << std::endl; |
| 1517 | } |
| 1518 | } |
| 1519 | return ret; |
| 1520 | } |
| 1521 | }; |
| 1522 | |
| 1523 | struct NewDeleteGeometryTest : public VerifyApplication::Test |