18 #ifndef itkGPUReduction_h
19 #define itkGPUReduction_h
39 template<
typename TElement >
61 itkGetMacro(GPUResult, TElement);
62 itkGetMacro(CPUResult, TElement);
65 itkGetOpenCLSourceFromKernelMacro(GPUReductionKernel);
67 unsigned int NextPow2(
unsigned int x );
68 bool isPow2(
unsigned int x);
69 void GetNumBlocksAndThreads(
int whichKernel,
int n,
int maxBlocks,
int maxThreads,
int &blocks,
int &threads);
70 unsigned int GetReductionKernel(
int whichKernel,
int blockSize,
int isPowOf2);
72 void AllocateGPUInputBuffer(TElement *h_idata = ITK_NULLPTR);
73 void ReleaseGPUInputBuffer();
74 void InitializeKernel(
unsigned int size);
76 TElement RandomTest();
77 TElement GPUGenerateData();
78 TElement CPUGenerateData(TElement *data,
int size);
80 TElement GPUReduce( cl_int n,
86 bool cpuFinalReduction,
87 int cpuFinalThreshold,
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "itkGPUReduction.hxx"
virtual void PrintSelf(std::ostream &os, Indent indent) const override
Light weight base class for most itk classes.
GPUDataPointer m_GPUDataManager
int m_ReduceGPUKernelHandle
SmartPointer< Self > Pointer
GPUDataManager::Pointer GPUDataPointer
SmartPointer< const Self > ConstPointer
itkGPUKernelClassMacro(GPUImageOpsKernel)
GPU memory manager implemented using OpenCL. Required by GPUImage class.
GPUKernelManager::Pointer m_GPUKernelManager
int m_TestGPUKernelHandle
Control indentation during Print() invocation.
Base class for most ITK classes.