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

Method addOp

core/graph.cpp:354–372  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

352 }
353
354 void Graph::addOp(const Ref<Op>& op,
355 const std::vector<Ref<Op>>& srcOps,
356 bool concatSrcs)
357 {
358 if (finalized)
359 throw std::logic_error("graph cannot be changed after finalization");
360
361 const int opID = int(ops.size());
362
363 // Add the source tensor allocations as dependencies for the operation
364 std::vector<int> srcAllocIDs;
365 for (const auto& srcOp : srcOps)
366 srcAllocIDs.push_back(tensorAllocs[srcOp.get()]->id);
367 tensorScratchPlanner.addDepAllocs(opID, srcAllocIDs, concatSrcs);
368
369 ops.push_back(op);
370 workAmount += op->getWorkAmount();
371 dirty = true;
372 }
373
374 std::shared_ptr<Graph::TensorAlloc> Graph::addOp(
375 const Ref<Op>& op,

Callers

nothing calls this directly

Calls 6

sizeMethod · 0.80
addDepAllocsMethod · 0.80
newAllocMethod · 0.80
getMethod · 0.45
getByteSizeMethod · 0.45

Tested by

no test coverage detected