ITK  4.8.0
Insight Segmentation and Registration Toolkit
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
itk::GPUReduction< TElement > Class Template Reference

#include <itkGPUReduction.h>

+ Inheritance diagram for itk::GPUReduction< TElement >:
+ Collaboration diagram for itk::GPUReduction< TElement >:

Detailed Description

template<typename TElement>
class itk::GPUReduction< TElement >

This class encapsulate the parallel reduction algorithm. An example of this algorithm is to compute the sum of a long array in parallel.

Definition at line 40 of file itkGPUReduction.h.

Public Types

typedef SmartPointer< const SelfConstPointer
 
typedef GPUDataManager::Pointer GPUDataPointer
 
typedef SmartPointer< SelfPointer
 
typedef GPUReduction Self
 
typedef Object Superclass
 
- Public Types inherited from itk::Object
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef Object Self
 
typedef LightObject Superclass
 
- Public Types inherited from itk::LightObject
typedef SmartPointer< const SelfConstPointer
 
typedef SmartPointer< SelfPointer
 
typedef LightObject Self
 

Public Member Functions

void AllocateGPUInputBuffer (TElement *h_idata=nullptr)
 
TElement CPUGenerateData (TElement *data, int size)
 
virtual ::itk::LightObject::Pointer CreateAnother () const
 
virtual TElement GetCPUResult ()
 
virtual GPUDataPointer GetGPUDataManager ()
 
virtual TElement GetGPUResult ()
 
virtual const char * GetNameOfClass () const
 
void GetNumBlocksAndThreads (int whichKernel, int n, int maxBlocks, int maxThreads, int &blocks, int &threads)
 
unsigned int GetReductionKernel (int whichKernel, int blockSize, int isPowOf2)
 
TElement GPUGenerateData ()
 
TElement GPUReduce (cl_int n, int numThreads, int numBlocks, int maxThreads, int maxBlocks, int whichKernel, bool cpuFinalReduction, int cpuFinalThreshold, double *dTotalTime, GPUDataPointer idata, GPUDataPointer odata)
 
void InitializeKernel (unsigned int size)
 
bool isPow2 (unsigned int x)
 
 itkGetOpenCLSourceFromKernelMacro (GPUReductionKernel)
 
unsigned int NextPow2 (unsigned int x)
 
TElement RandomTest ()
 
void ReleaseGPUInputBuffer ()
 
- Public Member Functions inherited from itk::Object
unsigned long AddObserver (const EventObject &event, Command *)
 
unsigned long AddObserver (const EventObject &event, Command *) 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
 
virtual void Register () const override
 
void RemoveAllObservers ()
 
void RemoveObserver (unsigned long tag)
 
void SetDebug (bool debugFlag) const
 
void SetMetaDataDictionary (const MetaDataDictionary &rhs)
 
virtual void SetReferenceCount (int) override
 
virtual void UnRegister () const noexceptoverride
 
virtual void SetObjectName (std::string _arg)
 
virtual const std::string & GetObjectName () const
 
- Public Member Functions inherited from itk::LightObject
virtual void Delete ()
 
virtual int GetReferenceCount () const
 
 itkCloneMacro (Self)
 
void Print (std::ostream &os, Indent indent=0) const
 

Static Public Member Functions

static Pointer New ()
 
- Static Public Member Functions inherited from itk::Object
static bool GetGlobalWarningDisplay ()
 
static void GlobalWarningDisplayOff ()
 
static void GlobalWarningDisplayOn ()
 
static Pointer New ()
 
static void SetGlobalWarningDisplay (bool flag)
 
- Static Public Member Functions inherited from itk::LightObject
static void BreakOnError ()
 
static Pointer New ()
 

Protected Member Functions

 GPUReduction ()
 
void PrintSelf (std::ostream &os, Indent indent) const override
 
 ~GPUReduction ()
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &time)
 
virtual ~Object ()
 
- 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 ()
 

Protected Attributes

TElement m_CPUResult
 
GPUDataPointer m_GPUDataManager
 
GPUKernelManager::Pointer m_GPUKernelManager
 
TElement m_GPUResult
 
int m_ReduceGPUKernelHandle
 
unsigned int m_Size
 
bool m_SmallBlock
 
int m_TestGPUKernelHandle
 
- Protected Attributes inherited from itk::LightObject
AtomicInt< int > m_ReferenceCount
 

Private Member Functions

 GPUReduction (const Self &)
 
void operator= (const Self &)
 

Member Typedef Documentation

template<typename TElement>
typedef SmartPointer< const Self > itk::GPUReduction< TElement >::ConstPointer

Definition at line 49 of file itkGPUReduction.h.

template<typename TElement>
typedef GPUDataManager::Pointer itk::GPUReduction< TElement >::GPUDataPointer

Definition at line 56 of file itkGPUReduction.h.

template<typename TElement>
typedef SmartPointer< Self > itk::GPUReduction< TElement >::Pointer

Definition at line 48 of file itkGPUReduction.h.

template<typename TElement>
typedef GPUReduction itk::GPUReduction< TElement >::Self

Standard class typedefs.

Definition at line 46 of file itkGPUReduction.h.

template<typename TElement>
typedef Object itk::GPUReduction< TElement >::Superclass

Definition at line 47 of file itkGPUReduction.h.

Constructor & Destructor Documentation

template<typename TElement>
itk::GPUReduction< TElement >::GPUReduction ( )
protected
template<typename TElement>
itk::GPUReduction< TElement >::~GPUReduction ( )
protected
template<typename TElement>
itk::GPUReduction< TElement >::GPUReduction ( const Self )
private

Member Function Documentation

template<typename TElement>
void itk::GPUReduction< TElement >::AllocateGPUInputBuffer ( TElement *  h_idata = nullptr)
template<typename TElement>
TElement itk::GPUReduction< TElement >::CPUGenerateData ( TElement *  data,
int  size 
)
template<typename TElement>
virtual::itk::LightObject::Pointer itk::GPUReduction< TElement >::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.

template<typename TElement>
virtual TElement itk::GPUReduction< TElement >::GetCPUResult ( )
virtual
template<typename TElement>
virtual GPUDataPointer itk::GPUReduction< TElement >::GetGPUDataManager ( )
virtual
template<typename TElement>
virtual TElement itk::GPUReduction< TElement >::GetGPUResult ( )
virtual
template<typename TElement>
virtual const char* itk::GPUReduction< TElement >::GetNameOfClass ( ) const
virtual

Run-time type information (and related methods).

Reimplemented from itk::Object.

template<typename TElement>
void itk::GPUReduction< TElement >::GetNumBlocksAndThreads ( int  whichKernel,
int  n,
int  maxBlocks,
int  maxThreads,
int &  blocks,
int &  threads 
)
template<typename TElement>
unsigned int itk::GPUReduction< TElement >::GetReductionKernel ( int  whichKernel,
int  blockSize,
int  isPowOf2 
)
template<typename TElement>
TElement itk::GPUReduction< TElement >::GPUGenerateData ( )
template<typename TElement>
TElement itk::GPUReduction< TElement >::GPUReduce ( cl_int  n,
int  numThreads,
int  numBlocks,
int  maxThreads,
int  maxBlocks,
int  whichKernel,
bool  cpuFinalReduction,
int  cpuFinalThreshold,
double *  dTotalTime,
GPUDataPointer  idata,
GPUDataPointer  odata 
)
template<typename TElement>
void itk::GPUReduction< TElement >::InitializeKernel ( unsigned int  size)
template<typename TElement>
bool itk::GPUReduction< TElement >::isPow2 ( unsigned int  x)
template<typename TElement>
itk::GPUReduction< TElement >::itkGetOpenCLSourceFromKernelMacro ( GPUReductionKernel  )

Get OpenCL Kernel source as a string, creates a GetOpenCLSource method

template<typename TElement>
static Pointer itk::GPUReduction< TElement >::New ( )
static

Method for creation through the object factory.

template<typename TElement>
unsigned int itk::GPUReduction< TElement >::NextPow2 ( unsigned int  x)
template<typename TElement>
void itk::GPUReduction< TElement >::operator= ( const Self )
private
template<typename TElement>
void itk::GPUReduction< TElement >::PrintSelf ( std::ostream &  os,
Indent  indent 
) const
overrideprotectedvirtual

Methods invoked by Print() to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.

Reimplemented from itk::Object.

template<typename TElement>
TElement itk::GPUReduction< TElement >::RandomTest ( )
template<typename TElement>
void itk::GPUReduction< TElement >::ReleaseGPUInputBuffer ( )

Member Data Documentation

template<typename TElement>
TElement itk::GPUReduction< TElement >::m_CPUResult
protected

Definition at line 108 of file itkGPUReduction.h.

template<typename TElement>
GPUDataPointer itk::GPUReduction< TElement >::m_GPUDataManager
protected

Definition at line 99 of file itkGPUReduction.h.

template<typename TElement>
GPUKernelManager::Pointer itk::GPUReduction< TElement >::m_GPUKernelManager
protected

GPU kernel manager for GPUFiniteDifferenceFunction class

Definition at line 98 of file itkGPUReduction.h.

template<typename TElement>
TElement itk::GPUReduction< TElement >::m_GPUResult
protected

Definition at line 108 of file itkGPUReduction.h.

template<typename TElement>
int itk::GPUReduction< TElement >::m_ReduceGPUKernelHandle
protected

Definition at line 102 of file itkGPUReduction.h.

template<typename TElement>
unsigned int itk::GPUReduction< TElement >::m_Size
protected

Definition at line 105 of file itkGPUReduction.h.

template<typename TElement>
bool itk::GPUReduction< TElement >::m_SmallBlock
protected

Definition at line 106 of file itkGPUReduction.h.

template<typename TElement>
int itk::GPUReduction< TElement >::m_TestGPUKernelHandle
protected

Definition at line 103 of file itkGPUReduction.h.


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