MyCaffe  1.12.2.41
Deep learning software for Windows C# programmers.
MyCaffe.common.InternalThread< T > Class Template Reference

The InternalThread manages an internal thread used for Parallel and data collection operations. More...

Inheritance diagram for MyCaffe.common.InternalThread< T >:
MyCaffe.common.Worker< T >

Public Member Functions

 InternalThread (bool bUseThreadVsTask=false)
 The InternalThread constructor. More...
 
void Dispose ()
 Releases all resources used by the InernalThread. More...
 
void StartInternalThread (CudaDnn< T > cuda, Log log, int nDeviceID=0, object arg=null, int nInitialDelay=0)
 Starts running the internal thread function which then calls the DoWork event. More...
 
void StopInternalThread ()
 Stops the internal thread. More...
 

Protected Member Functions

virtual void Dispose (bool bDisposing)
 Releases all resources used by the InernalThread. More...
 
void InternalThreadEntry (object obj)
 Specifies the internal thread entry. More...
 

Properties

bool CancellationPending [get]
 Returns whether or not a cancellation is pending. More...
 
bool IsStarted [get]
 Returns whether or not the internal thread has been started. More...
 

Events

EventHandler< ActionStateArgs< T > > DoWork
 The DoWork event is the working thread function. More...
 
EventHandler OnPreStop
 The OnPreStop event fires just after signalling the thread to stop. More...
 
EventHandler OnPreStart
 The OnPreStart event fires just before starting the thread. More...
 

Detailed Description

The InternalThread manages an internal thread used for Parallel and data collection operations.

Template Parameters
TSpecifies the base type float or double. Using float is recommended to conserve GPU memory.

Definition at line 15 of file InternalThread.cs.

Constructor & Destructor Documentation

◆ InternalThread()

MyCaffe.common.InternalThread< T >.InternalThread ( bool  bUseThreadVsTask = false)

The InternalThread constructor.

Parameters
bUseThreadVsTaskOptionally, specifies to use a Thread vs a Task (default = false, e.g. use Task).

Definition at line 42 of file InternalThread.cs.

Member Function Documentation

◆ Dispose() [1/2]

void MyCaffe.common.InternalThread< T >.Dispose ( )

Releases all resources used by the InernalThread.

Definition at line 68 of file InternalThread.cs.

◆ Dispose() [2/2]

virtual void MyCaffe.common.InternalThread< T >.Dispose ( bool  bDisposing)
protectedvirtual

Releases all resources used by the InernalThread.

Parameters
bDisposingSet to true when called from Dispose().

Definition at line 51 of file InternalThread.cs.

◆ InternalThreadEntry()

void MyCaffe.common.InternalThread< T >.InternalThreadEntry ( object  obj)
protected

Specifies the internal thread entry.

Parameters
obj

Definition at line 141 of file InternalThread.cs.

◆ StartInternalThread()

void MyCaffe.common.InternalThread< T >.StartInternalThread ( CudaDnn< T >  cuda,
Log  log,
int  nDeviceID = 0,
object  arg = null,
int  nInitialDelay = 0 
)

Starts running the internal thread function which then calls the DoWork event.

Parameters
cudaSpecifies the CudaDnn connection to Cuda placed in the ActionStartArgs passed along to DoWork.
logSpecifies the Log for output, placed in the ActionStartArgs passed along to DoWork.
nDeviceIDOptionally, specifies the DeviceID placed in the ActionStartArgs passed along to DoWork.
argOptionally, specifies an argument defined by the caller.
nInitialDelayOptionally, specifies an initial delay in ms (default = 0).

Definition at line 81 of file InternalThread.cs.

◆ StopInternalThread()

void MyCaffe.common.InternalThread< T >.StopInternalThread ( )

Stops the internal thread.

Definition at line 117 of file InternalThread.cs.

Property Documentation

◆ CancellationPending

bool MyCaffe.common.InternalThread< T >.CancellationPending
get

Returns whether or not a cancellation is pending.

Definition at line 164 of file InternalThread.cs.

◆ IsStarted

bool MyCaffe.common.InternalThread< T >.IsStarted
get

Returns whether or not the internal thread has been started.

Definition at line 178 of file InternalThread.cs.

Event Documentation

◆ DoWork

EventHandler<ActionStateArgs<T> > MyCaffe.common.InternalThread< T >.DoWork

The DoWork event is the working thread function.

Definition at line 28 of file InternalThread.cs.

◆ OnPreStart

EventHandler MyCaffe.common.InternalThread< T >.OnPreStart

The OnPreStart event fires just before starting the thread.

Definition at line 36 of file InternalThread.cs.

◆ OnPreStop

EventHandler MyCaffe.common.InternalThread< T >.OnPreStop

The OnPreStop event fires just after signalling the thread to stop.

Definition at line 32 of file InternalThread.cs.


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