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

Data Structures

struct  AsyncPollingNetStats
 

Public Member Functions

 AsyncPollingNet (const std::shared_ptr< const NetDef > &net_def, Workspace *ws)
 
- 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
 
- 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 bool RunAsync ()
 
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 >
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 DoRunAsync () override
 
bool pollAndSchedule ()
 
void schedule (int task_id)
 
void updateTaskStats (int task_id)
 
void reset ()
 
 DISABLE_COPY_AND_ASSIGN (AsyncPollingNet)
 
- Protected Member Functions inherited from caffe2::AsyncNetBase
bool canSchedule (int chain_id, const std::vector< EventStatus > *status=nullptr)
 
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
 
void asyncWait (int task_id, int stream_id, const std::vector< int > &wait_task_ids) const
 
void run (int task_id, int stream_id)
 
int stream (int task_id)
 
std::shared_ptr< TaskThreadPoolpool (const DeviceOption &device_option)
 
void finishTasks (const std::unordered_set< int > &task_ids)
 
void finalizeEvents ()
 
bool isStreamFree (int task_id, int stream_id) const
 
 DISABLE_COPY_AND_ASSIGN (AsyncNetBase)
 
- Protected Member Functions inherited from caffe2::NetBase
 DISABLE_COPY_AND_ASSIGN (NetBase)
 

Protected Attributes

std::mutex running_mutex_
 
std::condition_variable running_cv_
 
std::atomic< bool > running_
 
std::vector< AsyncPollingNetStatsstats_
 
std::vector< std::unique_ptr< Timer > > task_timers_
 
std::vector< EventStatus > status_
 
std::atomic< bool > has_chain_failed_
 
- 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_
 
std::mutex pools_mutex_
 
std::vector< std::shared_ptr< TaskThreadPool > > gpu_pools_
 
std::shared_ptr< TaskThreadPoolcpu_pool_
 
std::shared_ptr< TaskThreadPoolgpu_pool_
 
- 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 >
 
- Static Protected Attributes inherited from caffe2::AsyncNetBase
static thread_local std::vector< int > stream_counters_
 

Detailed Description

Definition at line 24 of file net_async_polling.h.


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