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

Public Member Functions

 AsyncNetBase (const std::shared_ptr< const NetDef > &net_def, Workspace *ws)
bool SupportsAsync () override
vector< OperatorBase * > GetOperators () const override
bool RunAsync () 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 void Wait ()
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
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 Types

typedef std::unordered_map< int, std::unordered_map< int, std::shared_ptr< TaskThreadPoolBase > > > PoolsMap

Protected Member Functions

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
virtual void reset ()
bool handleRunError () override
void handleChainError (int task_id, OperatorBase *op, const char *err_msg, bool save_exception=false) noexcept
- Protected Member Functions inherited from caffe2::NetBase
virtual bool DoRunAsync ()

Static Protected Member Functions

static std::vector< int > & getStreamCounters ()

Protected Attributes

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_


class AsyncNetExecutorHelper
class tracing::Tracer

Additional Inherited Members

- Public Types inherited from caffe2::Observable< NetBase >
using Observer = ObserverBase< NetBase >

Detailed Description

Definition at line 58 of file net_async_base.h.

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