MCPcopy Create free account
hub / github.com/CRVI/OpenCLIPP / IsPlanCompatible

Method IsPlanCompatible

C++/programs/FFT.cpp:105–139  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

103}
104
105bool FFT::IsPlanCompatible(clfftPlanHandle ForwardPlan, const ImageBase& Real, const ImageBase& Complex)
106{
107 if (ForwardPlan == 0)
108 return false;
109
110 // Get values
111 clfftPrecision Precision = ENDPRECISION;
112 clfftGetPlanPrecision(ForwardPlan, &Precision);
113
114 size_t Lengths[2] = {0};
115 clfftGetPlanLength(ForwardPlan, CLFFT_2D, Lengths);
116
117 size_t RealStrides[2] = {0};
118 size_t ComplexStrides[2] = {0};
119 clfftGetPlanInStride(ForwardPlan, CLFFT_2D, RealStrides);
120 clfftGetPlanOutStride(ForwardPlan, CLFFT_2D, ComplexStrides);
121
122 // Compare values
123 if (Precision != CLFFT_SINGLE)
124 return false;
125
126 if (Lengths[0] != Real.Width())
127 return false;
128
129 if (Lengths[1] != Real.Height())
130 return false;
131
132 if (RealStrides[0] != 1 || RealStrides[1] != Real.ElementStep())
133 return false;
134
135 if (ComplexStrides[0] != 1 || ComplexStrides[1] * 2 != Complex.ElementStep())
136 return false;
137
138 return true;
139}
140
141void FFT::PrepareFor(const ImageBase& Real, const ImageBase& Complex)
142{

Callers

nothing calls this directly

Calls 3

WidthMethod · 0.80
HeightMethod · 0.80
ElementStepMethod · 0.80

Tested by

no test coverage detected