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

#include <itkGPUReduction.h>

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.

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

Public Types

using ConstPointer = SmartPointer< const Self >
 
using GPUDataPointer = GPUDataManager::Pointer
 
using Pointer = SmartPointer< Self >
 
using Self = GPUReduction
 
using Superclass = Object
 
- 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

void AllocateGPUInputBuffer (TElement *h_idata=nullptr)
 
TElement CPUGenerateData (TElement *data, int size)
 
virtual TElement GetCPUResult ()
 
virtual GPUDataPointer GetGPUDataManager ()
 
virtual TElement GetGPUResult ()
 
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)
 
 itkOverrideGetNameOfClassMacro (GPUReduction)
 
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
 
unsigned long AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const
 
LightObject::Pointer CreateAnother () const override
 
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
 
 itkOverrideGetNameOfClassMacro (Object)
 
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
 
 itkVirtualGetNameOfClassMacro (LightObject)
 
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 val)
 
- 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 () override
 
- Protected Member Functions inherited from itk::Object
 Object ()
 
bool PrintObservers (std::ostream &os, Indent indent) const
 
virtual void SetTimeStamp (const TimeStamp &timeStamp)
 
 ~Object () override
 
- 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
std::atomic< int > m_ReferenceCount {}
 

Member Typedef Documentation

◆ ConstPointer

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

Definition at line 49 of file itkGPUReduction.h.

◆ GPUDataPointer

template<typename TElement>
using itk::GPUReduction< TElement >::GPUDataPointer = GPUDataManager::Pointer

Definition at line 57 of file itkGPUReduction.h.

◆ Pointer

template<typename TElement>
using itk::GPUReduction< TElement >::Pointer = SmartPointer<Self>

Definition at line 48 of file itkGPUReduction.h.

◆ Self

template<typename TElement>
using itk::GPUReduction< TElement >::Self = GPUReduction

Standard class type aliases.

Definition at line 46 of file itkGPUReduction.h.

◆ Superclass

template<typename TElement>
using itk::GPUReduction< TElement >::Superclass = Object

Definition at line 47 of file itkGPUReduction.h.

Constructor & Destructor Documentation

◆ GPUReduction()

template<typename TElement>
itk::GPUReduction< TElement >::GPUReduction ( )
protected

◆ ~GPUReduction()

template<typename TElement>
itk::GPUReduction< TElement >::~GPUReduction ( )
overrideprotected

Member Function Documentation

◆ AllocateGPUInputBuffer()

template<typename TElement>
void itk::GPUReduction< TElement >::AllocateGPUInputBuffer ( TElement *  h_idata = nullptr)

◆ CPUGenerateData()

template<typename TElement>
TElement itk::GPUReduction< TElement >::CPUGenerateData ( TElement *  data,
int  size 
)

◆ GetCPUResult()

template<typename TElement>
virtual TElement itk::GPUReduction< TElement >::GetCPUResult ( )
virtual

◆ GetGPUDataManager()

template<typename TElement>
virtual GPUDataPointer itk::GPUReduction< TElement >::GetGPUDataManager ( )
virtual

◆ GetGPUResult()

template<typename TElement>
virtual TElement itk::GPUReduction< TElement >::GetGPUResult ( )
virtual

◆ GetNumBlocksAndThreads()

template<typename TElement>
void itk::GPUReduction< TElement >::GetNumBlocksAndThreads ( int  whichKernel,
int  n,
int  maxBlocks,
int  maxThreads,
int &  blocks,
int &  threads 
)

◆ GetReductionKernel()

template<typename TElement>
unsigned int itk::GPUReduction< TElement >::GetReductionKernel ( int  whichKernel,
int  blockSize,
int  isPowOf2 
)

◆ GPUGenerateData()

template<typename TElement>
TElement itk::GPUReduction< TElement >::GPUGenerateData ( )

◆ GPUReduce()

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 
)

◆ InitializeKernel()

template<typename TElement>
void itk::GPUReduction< TElement >::InitializeKernel ( unsigned int  size)

◆ isPow2()

template<typename TElement>
bool itk::GPUReduction< TElement >::isPow2 ( unsigned int  x)

◆ itkGetOpenCLSourceFromKernelMacro()

template<typename TElement>
itk::GPUReduction< TElement >::itkGetOpenCLSourceFromKernelMacro ( GPUReductionKernel  )

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

◆ itkOverrideGetNameOfClassMacro()

template<typename TElement>
itk::GPUReduction< TElement >::itkOverrideGetNameOfClassMacro ( GPUReduction< TElement >  )

Run-time type information (and related methods).

◆ New()

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

Method for creation through the object factory.

◆ NextPow2()

template<typename TElement>
unsigned int itk::GPUReduction< TElement >::NextPow2 ( unsigned int  x)

◆ PrintSelf()

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.

◆ RandomTest()

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

◆ ReleaseGPUInputBuffer()

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

Member Data Documentation

◆ m_CPUResult

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

Definition at line 119 of file itkGPUReduction.h.

◆ m_GPUDataManager

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

Definition at line 110 of file itkGPUReduction.h.

◆ m_GPUKernelManager

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

GPU kernel manager for GPUFiniteDifferenceFunction class

Definition at line 109 of file itkGPUReduction.h.

◆ m_GPUResult

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

Definition at line 119 of file itkGPUReduction.h.

◆ m_ReduceGPUKernelHandle

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

Definition at line 113 of file itkGPUReduction.h.

◆ m_Size

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

Definition at line 116 of file itkGPUReduction.h.

◆ m_SmallBlock

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

Definition at line 117 of file itkGPUReduction.h.

◆ m_TestGPUKernelHandle

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

Definition at line 114 of file itkGPUReduction.h.


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