18 #ifndef __itkGPUReduction_h
19 #define __itkGPUReduction_h
40 template<
class 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 =
NULL);
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;
112 void operator=(
const Self &);
117 #ifndef ITK_MANUAL_INSTANTIATION
118 #include "itkGPUReduction.hxx"