MCPcopy Create free account
hub / github.com/MegEngine/MegEngine / make_callback_copy

Method make_callback_copy

test/src/helper.cpp:426–435  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

424}
425
426cg::ComputingGraph::OutputSpecItem mgb::make_callback_copy(
427 SymbolVar dev, HostTensorND& host, bool sync) {
428 auto cb = [sync, &host](DeviceTensorND& d) {
429 host.copy_from(d);
430 if (sync) {
431 host.sync();
432 }
433 };
434 return {dev, cb};
435}
436
437/* ========================== PersistentCacheHook ========================== */
438class PersistentCacheHook::HookedImpl final : public PersistentCache {

Callers

nothing calls this directly

Calls 2

copy_fromMethod · 0.45
syncMethod · 0.45

Tested by

no test coverage detected