提交 1ce40b5b 编写于 作者: M Megvii Engine Team 提交者: huangxinda

refactor(interpreter): wrap accesses to channel/worker state

GitOrigin-RevId: 1d58f2c876024a0ea2a47d5226339bc0ed626c4b
上级 90d39057
......@@ -90,7 +90,6 @@ private:
void regenerate(TensorInfo* dest);
void recompute(TensorInfo::ComputePath* path);
void dispatch_default_cpu(
std::shared_ptr<OpDef> op,
......@@ -105,6 +104,10 @@ private:
bool check_available();
void assert_in_channel();
void assert_in_worker();
std::thread::id get_worker_tid();
void sync_device_scope(CompNode device);
template <typename TCommand>
......@@ -319,6 +322,11 @@ private:
//! automatically evict an optimal tensor
void auto_evict();
// assert thread id when call get_xxx_state to avoid misuse
ChannelState& get_channel_state();
WorkerState& get_worker_state();
};
} // namespace mgb::imperative::interpreter::intl
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册