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,
95 void PrintSelf(std::ostream & os,
Indent indent) const ITK_OVERRIDE;
102 int m_ReduceGPUKernelHandle;
103 int m_TestGPUKernelHandle;
108 TElement m_GPUResult, m_CPUResult;
116 #ifndef ITK_MANUAL_INSTANTIATION
117 #include "itkGPUReduction.hxx"
Light weight base class for most itk classes.
SmartPointer< Self > Pointer
GPUDataManager::Pointer GPUDataPointer
SmartPointer< const Self > ConstPointer
itkGPUKernelClassMacro(GPUImageOpsKernel)
GPU memory manager implemented using OpenCL. Required by GPUImage class.
GPU kernel manager implemented using OpenCL.
Control indentation during Print() invocation.
Base class for most ITK classes.