18#ifndef itkGPUReduction_h
19#define itkGPUReduction_h
39template <
typename TElement>
60 itkGetMacro(GPUResult, TElement);
61 itkGetMacro(CPUResult, TElement);
96 bool cpuFinalReduction,
97 int cpuFinalThreshold,
113 int m_ReduceGPUKernelHandle{};
114 int m_TestGPUKernelHandle{};
116 unsigned int m_Size{};
119 TElement m_GPUResult, m_CPUResult{};
123#ifndef ITK_MANUAL_INSTANTIATION
124# include "itkGPUReduction.hxx"
GPU memory manager implemented using OpenCL. Required by GPUImage class.
SmartPointer< Self > Pointer
unsigned int NextPow2(unsigned int x)
void PrintSelf(std::ostream &os, Indent indent) const override
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)
TElement CPUGenerateData(TElement *data, int size)
void ReleaseGPUInputBuffer()
unsigned int GetReductionKernel(int whichKernel, int blockSize, int isPowOf2)
void GetNumBlocksAndThreads(int whichKernel, int n, int maxBlocks, int maxThreads, int &blocks, int &threads)
bool isPow2(unsigned int x)
TElement GPUGenerateData()
void AllocateGPUInputBuffer(TElement *h_idata=nullptr)
void InitializeKernel(unsigned int size)
itkGetOpenCLSourceFromKernelMacro(GPUReductionKernel)
Control indentation during Print() invocation.
Light weight base class for most itk classes.
Base class for most ITK classes.
The "itk" namespace contains all Insight Segmentation and Registration Toolkit (ITK) classes....
itkGPUKernelClassMacro(GPUImageOpsKernel)