ITK  5.2.0
Insight Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Friends | List of all members
itk::TBBMultiThreader Class Reference

#include <itkTBBMultiThreader.h>

+ Inheritance diagram for itk::TBBMultiThreader:
+ Collaboration diagram for itk::TBBMultiThreader:

Public Types

using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = TBBMultiThreader
 
using Superclass = MultiThreaderBase
 
- Public Types inherited from itk::MultiThreaderBase
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = MultiThreaderBase
 
using Superclass = Object
 
using ThreaderEnum = MultiThreaderBaseEnums::Threader
 
template<unsigned int VDimension>
using TemplatedThreadingFunctorType = std::function< void(const ImageRegion< VDimension > &)>
 
using ThreadingFunctorType = std::function< void(const IndexValueType index[], const SizeValueType size[])>
 
using ArrayThreadingFunctorType = std::function< void(SizeValueType)>
 
- Public Types inherited from itk::Object
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = Object
 
using Superclass = LightObject
 
- Public Types inherited from itk::LightObject
using ConstPointer = SmartPointer< const Self >
 
using Pointer = SmartPointer< Self >
 
using Self = LightObject
 

Public Member Functions

virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual const char * GetNameOfClass () const
 
void ParallelizeArray (SizeValueType firstIndex, SizeValueType lastIndexPlus1, ArrayThreadingFunctorType aFunc, ProcessObject *filter) override
 
void ParallelizeImageRegion (unsigned int dimension, const IndexValueType index[], const SizeValueType size[], ThreadingFunctorType funcP, ProcessObject *filter) override
 
void SetNumberOfWorkUnits (ThreadIdType numberOfWorkUnits) override
 
void SetSingleMethod (ThreadFunctionType, void *data) override
 
void SingleMethodExecute () override
 
- Public Member Functions inherited from itk::MultiThreaderBase
virtual void SetMaximumNumberOfThreads (ThreadIdType numberOfThreads)
 
virtual ThreadIdType GetMaximumNumberOfThreads () const
 
virtual ThreadIdType GetNumberOfWorkUnits () const
 
virtual void SetUpdateProgress (bool updates)
 
virtual bool GetUpdateProgress () const
 
 itkLegacyMacro (static void SetGlobalDefaultUseThreadPool(const bool GlobalDefaultUseThreadPool))
 
 itkLegacyMacro (static bool GetGlobalDefaultUseThreadPool())
 
template<unsigned int VDimension>
ITK_TEMPLATE_EXPORT void ParallelizeImageRegion (const ImageRegion< VDimension > &requestedRegion, TemplatedThreadingFunctorType< VDimension > funcP, ProcessObject *filter)
 
template<unsigned int VDimension>
ITK_TEMPLATE_EXPORT void ParallelizeImageRegionRestrictDirection (unsigned int restrictedDirection, const ImageRegion< VDimension > &requestedRegion, TemplatedThreadingFunctorType< VDimension > funcP, ProcessObject *filter)
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) const
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
virtual void DebugOff () const
 
virtual void DebugOn () const
 
CommandGetCommand (unsigned long tag)
 
bool GetDebug () const
 
MetaDataDictionaryGetMetaDataDictionary ()
 
const MetaDataDictionaryGetMetaDataDictionary () const
 
virtual ModifiedTimeType GetMTime () const
 
virtual const TimeStampGetTimeStamp () const
 
bool HasObserver (const EventObject &event) const
 
void InvokeEvent (const EventObject &)
 
void InvokeEvent (const EventObject &) const
 
virtual void Modified () const
 
void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetReferenceCount (int) override
 
void UnRegister () const noexcept override
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
void SetMetaDataDictionary (MetaDataDictionary &&rrhs)
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
Pointer Clone () const
 
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::MultiThreaderBase
static Pointer New ()
 
static void SetGlobalMaximumNumberOfThreads (ThreadIdType val)
 
static ThreadIdType GetGlobalMaximumNumberOfThreads ()
 
static ThreaderEnum ThreaderTypeFromString (std::string threaderString)
 
static std::string ThreaderTypeToString (ThreaderEnum threader)
 
static void SetGlobalDefaultThreader (ThreaderEnum threaderType)
 
static ThreaderEnum GetGlobalDefaultThreader ()
 
static void SetGlobalDefaultNumberOfThreads (ThreadIdType val)
 
static ThreadIdType GetGlobalDefaultNumberOfThreads ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool val)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

void PrintSelf (std::ostream &os, Indent indent) const override
 
 TBBMultiThreader ()
 
 ~TBBMultiThreader () override
 
- Protected Member Functions inherited from itk::MultiThreaderBase
 MultiThreaderBase ()
 
 ~MultiThreaderBase () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
 ~Object () override
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
- Protected Member Functions inherited from itk::LightObject
virtual LightObject::Pointer InternalClone () const
 
 LightObject ()
 
virtual void PrintHeader (std::ostream &os, Indent indent) const
 
virtual void PrintTrailer (std::ostream &os, Indent indent) const
 
virtual ~LightObject ()
 

Friends

class ProcessObject
 

Additional Inherited Members

- Static Protected Member Functions inherited from itk::MultiThreaderBase
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ParallelizeArrayHelper (void *arg)
 
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION ParallelizeImageRegionHelper (void *arg)
 
static ITK_THREAD_RETURN_FUNCTION_CALL_CONVENTION SingleMethodProxy (void *arg)
 
- Protected Attributes inherited from itk::MultiThreaderBase
ThreadIdType m_NumberOfWorkUnits
 
ThreadIdType m_MaximumNumberOfThreads
 
ThreadFunctionType m_SingleMethod { nullptr }
 
void * m_SingleData { nullptr }
 
- Protected Attributes inherited from itk::LightObject
std::atomic< int > m_ReferenceCount
 

Detailed Description

A class for performing multithreaded execution with a thread pool back end, uses the Intel Threading Building Blocks (TBB) library.

This multi-threader implementation generates dynamically-sized thread-regions, and is expected to provide best performance.

Definition at line 38 of file itkTBBMultiThreader.h.

Member Typedef Documentation

◆ ConstPointer

Definition at line 47 of file itkTBBMultiThreader.h.

◆ Pointer

Definition at line 46 of file itkTBBMultiThreader.h.

◆ Self

Standard class type aliases.

Definition at line 44 of file itkTBBMultiThreader.h.

◆ Superclass

Definition at line 45 of file itkTBBMultiThreader.h.

Constructor & Destructor Documentation

◆ TBBMultiThreader()

itk::TBBMultiThreader::TBBMultiThreader ( )
protected

◆ ~TBBMultiThreader()

itk::TBBMultiThreader::~TBBMultiThreader ( )
overrideprotected

Member Function Documentation

◆ CreateAnother()

virtual::itk::LightObject::Pointer itk::TBBMultiThreader::CreateAnother ( ) const
virtual

Create an object from an instance, potentially deferring to a factory. This method allows you to create an instance of an object that is exactly the same type as the referring object. This is useful in cases where an object has been cast back to a base class.

Reimplemented from itk::Object.

◆ GetNameOfClass()

virtual const char* itk::TBBMultiThreader::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::MultiThreaderBase.

◆ New()

static Pointer itk::TBBMultiThreader::New ( )
static

Method for creation through the object factory.

◆ ParallelizeArray()

void itk::TBBMultiThreader::ParallelizeArray ( SizeValueType  firstIndex,
SizeValueType  lastIndexPlus1,
ArrayThreadingFunctorType  aFunc,
ProcessObject filter 
)
overridevirtual

Parallelize an operation over an array. If filter argument is not nullptr, this function will update its progress as each index is completed.

Reimplemented from itk::MultiThreaderBase.

◆ ParallelizeImageRegion()

void itk::TBBMultiThreader::ParallelizeImageRegion ( unsigned int  dimension,
const IndexValueType  index[],
const SizeValueType  size[],
ThreadingFunctorType  funcP,
ProcessObject filter 
)
overridevirtual

Break up region into smaller chunks, and call the function with chunks as parameters.

Reimplemented from itk::MultiThreaderBase.

◆ PrintSelf()

void itk::TBBMultiThreader::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

The number of work units to create.

Reimplemented from itk::MultiThreaderBase.

◆ SetNumberOfWorkUnits()

void itk::TBBMultiThreader::SetNumberOfWorkUnits ( ThreadIdType  numberOfWorkUnits)
overridevirtual

Get/Set the number of work units to create. TBBMultiThreader does not limit the number of work units. This number is only respected by SetSingleMethod/SingleMethodExecute.

Reimplemented from itk::MultiThreaderBase.

◆ SetSingleMethod()

void itk::TBBMultiThreader::SetSingleMethod ( ThreadFunctionType  ,
void *  data 
)
overridevirtual

Set the SingleMethod to f() and the UserData field of the WorkUnitInfo that is passed to it will be data. This method must be of type itkThreadFunctionType and must take a single argument of type void.

Implements itk::MultiThreaderBase.

◆ SingleMethodExecute()

void itk::TBBMultiThreader::SingleMethodExecute ( )
overridevirtual

Execute the SingleMethod (as define by SetSingleMethod) using m_NumberOfWorkUnits work units. As a side effect the m_NumberOfWorkUnits will be checked against the current m_GlobalMaximumNumberOfThreads and clamped if necessary.

Implements itk::MultiThreaderBase.

Friends And Related Function Documentation

◆ ProcessObject

friend class ProcessObject
friend

ProcessObject is a friend so that it can call PrintSelf() on its Multithreader.

Friends of DataObject

Definition at line 99 of file itkTBBMultiThreader.h.


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