18 #ifndef itkGPUReduction_h
19 #define itkGPUReduction_h
39 template <
typename TElement>
60 itkGetMacro(GPUResult, TElement);
61 itkGetMacro(CPUResult, TElement);
64 itkGetOpenCLSourceFromKernelMacro(GPUReductionKernel);
67 NextPow2(
unsigned int x);
69 isPow2(
unsigned int x);
71 GetNumBlocksAndThreads(
int whichKernel,
int n,
int maxBlocks,
int maxThreads,
int & blocks,
int & threads);
73 GetReductionKernel(
int whichKernel,
int blockSize,
int isPowOf2);
76 AllocateGPUInputBuffer(TElement * h_idata =
nullptr);
78 ReleaseGPUInputBuffer();
80 InitializeKernel(
unsigned int size);
87 CPUGenerateData(TElement * data,
int size);
96 bool cpuFinalReduction,
97 int cpuFinalThreshold,
106 PrintSelf(std::ostream & os,
Indent indent)
const override;
113 int m_ReduceGPUKernelHandle{};
114 int m_TestGPUKernelHandle{};
116 unsigned int m_Size{};
123 #ifndef ITK_MANUAL_INSTANTIATION
124 # include "itkGPUReduction.hxx"