Caffe2 - C++ API
A deep learning, cross platform ML framework
Public Member Functions | Protected Member Functions | Protected Attributes
caffe2::AsyncSchedulingNet Class Reference
Inheritance diagram for caffe2::AsyncSchedulingNet:
caffe2::AsyncNetBase caffe2::NetBase caffe2::Observable< NetBase >

Public Member Functions

 AsyncSchedulingNet (const std::shared_ptr< const NetDef > &net_def, Workspace *ws)
 
void Wait () override
 
- Public Member Functions inherited from caffe2::AsyncNetBase
 AsyncNetBase (const std::shared_ptr< const NetDef > &net_def, Workspace *ws)
 
bool SupportsAsync () override
 
vector< OperatorBase * > GetOperators () const override
 
const dag_utils::ExecutionChains & TEST_execution_chains () const
 
ProfDAGProtos GetOperatorStats () const
 
ProfDAGProtos GetPerOperatorCost () const
 
ProfDAGReport GetProfReport () const
 
- Public Member Functions inherited from caffe2::NetBase
 NetBase (const std::shared_ptr< const NetDef > &net_def, Workspace *ws)
 
const vector< const Event * > & events () const
 
virtual bool Run ()
 
virtual vector< float > TEST_Benchmark (const int, const int, const bool)
 Benchmarks a network. More...
 
const vector< string > & external_output () const
 
const vector< string > & external_input () const
 
const string & Name () const
 
const NetDef & debug_def () const
 
bool has_debug_def () const
 
- Public Member Functions inherited from caffe2::Observable< NetBase >
 Observable (Observable &&)=default
 
Observableoperator= (Observable &&)=default
 
 C10_DISABLE_COPY_AND_ASSIGN (Observable)
 
const ObserverAttachObserver (std::unique_ptr< Observer > observer)
 
std::unique_ptr< ObserverDetachObserver (const Observer *observer_ptr)
 Returns a unique_ptr to the removed observer. More...
 
virtual size_t NumObservers ()
 
void StartAllObservers ()
 
void StopAllObservers ()
 

Protected Member Functions

bool RunAsync () override
 
void pollAndSchedule (int task_id)
 
void schedule (int task_id, bool run_inline=false) noexcept
 
void reset () override
 
virtual void finishRun ()
 
void parentCallback (int parent_id)
 
bool isInlineTask (int parent_id, int child_id) const
 
 C10_DISABLE_COPY_AND_ASSIGN (AsyncSchedulingNet)
 
- Protected Member Functions inherited from caffe2::AsyncNetBase
bool canSchedule (int chain_id, const std::vector< EventStatus > *status=nullptr, bool *parent_failed=nullptr)
 
bool canSchedule (int parent_id, int child_id)
 
int tasksNum () const
 
Eventevent (int task_id) const
 
EventStatus query (int task_id) const
 
const std::vector< int > & children (int task_id) const
 
const std::vector< int > & parents (int task_id) const
 
int updateParentCount (int child_id)
 
int getParentCount (int child_id)
 
bool testAndSetScheduled (int task_id)
 
int numOps (int task_id) const
 
int firstTaskOpId (int task_id) const
 
int lastTaskOpId (int task_id) const
 
const OperatorBasefirstTaskOp (int task_id) const
 
const OperatorBaselastTaskOp (int task_id) const
 
OperatorBasefirstTaskOp (int task_id)
 
OperatorBaselastTaskOp (int task_id)
 
void asyncWait (int task_id, int stream_id, const std::vector< int > &wait_task_ids) const
 
bool run (int task_id, int stream_id) noexcept
 
int stream (int task_id)
 
TaskThreadPoolBasepool (const DeviceOption &device_option)
 
TaskThreadPoolBasepool ()
 
void finishTasks (const std::unordered_set< int > &task_ids)
 
void finalizeEvents ()
 
bool isStreamFree (int task_id, int stream_id) const
 
bool handleRunError () override
 
void handleChainError (int task_id, OperatorBase *op, const char *err_msg, bool save_exception=false) noexcept
 
 C10_DISABLE_COPY_AND_ASSIGN (AsyncNetBase)
 
- Protected Member Functions inherited from caffe2::NetBase
virtual bool DoRunAsync ()
 
 C10_DISABLE_COPY_AND_ASSIGN (NetBase)
 

Protected Attributes

std::mutex running_mutex_
 
std::condition_variable running_cv_
 
std::atomic< bool > running_
 
std::atomic< int > processed_tasks_num_
 
- Protected Attributes inherited from caffe2::AsyncNetBase
std::vector< OperatorBase * > operators_
 
std::vector< dag_utils::OperatorNodeoperator_nodes_
 
std::vector< std::vector< int > > chains_
 
std::vector< dag_utils::OpGraphNodechain_nodes_
 
dag_utils::ExecutionChains execution_chains_
 
std::mutex pools_mutex_
 
PoolsMap cpu_pools_
 
PoolsMap gpu_pools_
 
int num_workers_
 
std::atomic< bool > success_
 
std::shared_ptr< tracing::Tracertracer_
 
ExecutionOptions options_
 
ProfDAGCounters counters_
 
- Protected Attributes inherited from caffe2::NetBase
vector< string > external_input_
 
vector< string > external_output_
 
string name_
 
vector< const Event * > events_
 
std::shared_ptr< const NetDef > net_def_
 
- Protected Attributes inherited from caffe2::Observable< NetBase >
std::vector< std::unique_ptr< Observer > > observers_list_
 

Additional Inherited Members

- Public Types inherited from caffe2::Observable< NetBase >
using Observer = ObserverBase< NetBase >
 
- Protected Types inherited from caffe2::AsyncNetBase
typedef std::unordered_map< int, std::unordered_map< int, std::shared_ptr< TaskThreadPoolBase > > > PoolsMap
 
- Static Protected Member Functions inherited from caffe2::AsyncNetBase
static std::vector< int > & getStreamCounters ()
 

Detailed Description

Definition at line 8 of file net_async_scheduling.h.


The documentation for this class was generated from the following files: