MCPcopy Create free account
hub / github.com/RenderKit/oidn / submit

Method submit

core/graph.cpp:490–561  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

488 }
489
490 void Graph::submit(const Ref<Progress>& progress)
491 {
492 if (!finalized)
493 throw std::logic_error("graph not finalized");
494
495 #if defined(OIDN_MICROBENCH)
496 double totalTime = 0;
497 std::cerr << std::endl;
498 std::cerr << "op,name,msec" << std::endl;
499 #endif
500
501 for (size_t i = 0; i < ops.size(); ++i)
502 {
503 ops[i]->submit(progress);
504
505 #if defined(OIDN_MICROBENCH)
506 engine->wait();
507 const int numRuns = OIDN_MICROBENCH;
508 Timer timer;
509 for (int j = 0; j < numRuns; ++j)
510 ops[i]->submit(progress);
511 engine->wait();
512 const double time = timer.query() / numRuns;
513 std::cerr << i << "," << ops[i]->getName() << "," << time * 1000 << std::endl;
514 totalTime += time;
515 #endif
516
517 #if 0
518 // Dump
519 engine->wait();
520
521 Ref<Tensor> dst;
522
523 if (auto inputProcess = dynamicRefCast<InputProcess>(ops[i]))
524 dst = inputProcess->getDst();
525 else if (auto conv = dynamicRefCast<Conv>(ops[i]))
526 dst = conv->getDst();
527 else if (auto conv = dynamicRefCast<ConcatConv>(ops[i]))
528 dst = conv->getDst();
529 else if (auto pool = dynamicRefCast<Pool>(ops[i]))
530 dst = pool->getDst();
531 else if (auto upsample = dynamicRefCast<Upsample>(ops[i]))
532 dst = upsample->getDst();
533
534 if (dst)
535 {
536 const uint32_t refHash = dst->getHash();
537
538 std::cout << std::setfill('0') << std::setw(2) << i << ": "
539 << std::hex << std::setfill('0') << std::setw(8) << refHash << std::dec
540 << " " << ops[i]->getName() << std::endl;
541
542 /*
543 for (int j = 0; j < 100; ++j)
544 {
545 ops[i]->submit();
546 engine->wait();
547 const uint32_t hash = dst->getHash();

Callers

nothing calls this directly

Calls 7

toStringFunction · 0.85
sizeMethod · 0.80
getHashMethod · 0.80
dumpMethod · 0.80
waitMethod · 0.45
getNameMethod · 0.45
getDstMethod · 0.45

Tested by

no test coverage detected