mxnet/include/mxnet/engine.h
在名字空间 mxnet engine 中定义了抽象类Engine,用以规范接口,其接口有
NotifyShutdown
NewVariable
DeleteVariable
NewOperator
DeleteOperator
Push
PushAsync
PushSync
WaitForVar
WaitForAll
DeduplicateVarHandle
等
mxnet/src/engine/engine_impl.h
定义了多态实现的
Engine *CreateNaiveEngine
Engine *CreateThreadedEnginePolled
Engine *CreateThreadedEnginePerDevice
mxnet/src/engine/engine.cc
根据环境变量决定Engine *CreateEngine的选择情况。有三种形式
CreateNaiveEngine,CreateThreadedEnginePooled,CreateThreadEnginePerDevice。