18 #ifndef itkGPUReduction_h
19 #define itkGPUReduction_h
39 template<
typename TElement >
62 itkGetMacro(GPUResult, TElement);
63 itkGetMacro(CPUResult, TElement);
66 itkGetOpenCLSourceFromKernelMacro(GPUReductionKernel);
68 unsigned int NextPow2(
unsigned int x );
69 bool isPow2(
unsigned int x);
70 void GetNumBlocksAndThreads(
int whichKernel,
int n,
int maxBlocks,
int maxThreads,
int &blocks,
int &threads);
71 unsigned int GetReductionKernel(
int whichKernel,
int blockSize,
int isPowOf2);
73 void AllocateGPUInputBuffer(TElement *h_idata =
nullptr);
74 void ReleaseGPUInputBuffer();
75 void InitializeKernel(
unsigned int size);
77 TElement RandomTest();
78 TElement GPUGenerateData();
79 TElement CPUGenerateData(TElement *data,
int size);
81 TElement GPUReduce( cl_int n,
87 bool cpuFinalReduction,
88 int cpuFinalThreshold,
96 void PrintSelf(std::ostream & os,
Indent indent)
const override;
113 #ifndef ITK_MANUAL_INSTANTIATION
114 #include "itkGPUReduction.hxx"
Light weight base class for most itk classes.
GPUDataPointer m_GPUDataManager
int m_ReduceGPUKernelHandle
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.
SmartPointer< Self > Pointer