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

Method check_in_exec

src/opr/impl/io.cpp:48–65  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

46}
47
48void dv_helper::check_in_exec(const DeviceTensorND& val, VarNode* var) {
49 auto&& oval = var->dev_tensor();
50 if (!(val.comp_node().mem_node() == oval.comp_node().mem_node() &&
51 val.raw_ptr() == oval.raw_ptr() && val.layout().eq_layout(oval.layout()) &&
52 val.dtype() == var->dtype())) {
53 var->owner_opr()->owner_graph()->record_async_error(
54 cg::OperatorNodeExcExtraInfo::ExcMaker{var->owner_opr()}
55 .make_unique<MegBrainError>(ssprintf(
56 "value changed in DeviceTensorHolder: cn=(%s,%s), "
57 "ptr=(%p,%p), "
58 "layout=(%s,%s), dtype=(%s,%s)",
59 val.comp_node().to_string().c_str(),
60 oval.comp_node().to_string().c_str(), val.raw_ptr(),
61 oval.raw_ptr(), val.layout().to_string().c_str(),
62 oval.layout().to_string().c_str(), val.dtype().name(),
63 var->dtype().name())));
64 }
65}
66
67/* ===================== HostIONodeBase ===================== */
68

Callers

nothing calls this directly

Calls 12

eq_layoutMethod · 0.80
dev_tensorMethod · 0.45
mem_nodeMethod · 0.45
comp_nodeMethod · 0.45
raw_ptrMethod · 0.45
layoutMethod · 0.45
dtypeMethod · 0.45
record_async_errorMethod · 0.45
owner_graphMethod · 0.45
owner_oprMethod · 0.45
to_stringMethod · 0.45
nameMethod · 0.45

Tested by

no test coverage detected