MCPcopy Create free account
hub / github.com/arrayfire/arrayfire / fft_c2r

Function fft_c2r

src/backend/opencl/fft.cpp:129–155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

127
128template<typename Tr, typename Tc>
129Array<Tr> fft_c2r(const Array<Tc> &in, const dim4 &odims, const int rank) {
130 Array<Tr> out = createEmptyArray<Tr>(odims);
131
132 verifySupported(rank, odims);
133 size_t tdims[AF_MAX_DIMS], istrides[AF_MAX_DIMS], ostrides[AF_MAX_DIMS];
134
135 computeDims(tdims, odims);
136 computeDims(istrides, in.strides());
137 computeDims(ostrides, out.strides());
138
139 int batch = 1;
140 for (int i = rank; i < AF_MAX_DIMS; i++) { batch *= tdims[i]; }
141
142 SharedPlan plan = findPlan(
143 CLFFT_HERMITIAN_INTERLEAVED, CLFFT_REAL, static_cast<clfftDim>(rank),
144 tdims, istrides, istrides[rank], ostrides, ostrides[rank],
145 static_cast<clfftPrecision>(Precision<Tc>::type), batch);
146
147 cl_mem imem = (*in.get())();
148 cl_mem omem = (*out.get())();
149 cl_command_queue queue = getQueue()();
150
151 CLFFT_CHECK(clfftEnqueueTransform(*plan.get(), CLFFT_BACKWARD, 1, &queue, 0,
152 NULL, NULL, &imem, &omem, NULL));
153
154 return out;
155}
156
157#define INSTANTIATE(T) \
158 template void fft_inplace<T>(Array<T> &, const int, const bool);

Callers

nothing calls this directly

Calls 6

verifySupportedFunction · 0.85
computeDimsFunction · 0.70
findPlanFunction · 0.70
getQueueFunction · 0.50
stridesMethod · 0.45
getMethod · 0.45

Tested by

no test coverage detected