提交 47bdb4ef 编写于 作者: M Megvii Engine Team

fix(mgb/core): add MGB_HAVE_THREAD macro to thread_local

GitOrigin-RevId: cfcb50b041175e801a35fec1e16bb408403594c7
上级 5b62acfa
......@@ -247,7 +247,7 @@ class CpuCompNode::CompNodeImpl final: public CpuDispatchableBase {
//! https://github.com/tensorflow/tensorflow/issues/18356
//! thread local is no support on IOS,
//! When update x-xode, this code should be deleted
#ifndef IOS
#if !defined(IOS) && MGB_HAVE_THREAD
static thread_local SeqRecorderImpl* sm_cur_recorder;
#else
SeqRecorderImpl* sm_cur_recorder = nullptr;
......@@ -463,7 +463,7 @@ class CpuCompNode::CompNodeImpl final: public CpuDispatchableBase {
}
//! current sequence recorder of this thread
#ifndef IOS
#if !defined(IOS) && MGB_HAVE_THREAD
static SeqRecorderImpl* cur_recorder() { return sm_cur_recorder; }
#else
SeqRecorderImpl* cur_recorder() { return sm_cur_recorder; }
......@@ -479,7 +479,7 @@ class CpuCompNode::CompNodeImpl final: public CpuDispatchableBase {
};
MGB_DYN_TYPE_OBJ_FINAL_IMPL(CpuCompNodeImpl);
CpuCompNodeImpl* CpuCompNodeImpl::sm_default_cpu_comp_node_ptr;
#ifndef IOS
#if !defined(IOS) && MGB_HAVE_THREAD
thread_local CpuCompNode::SeqRecorderImpl* CpuCompNodeImpl::sm_cur_recorder =
nullptr;
#endif
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册