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

Function fft_inplace

src/backend/opencl/fft.cpp:72–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

70
71template<typename T>
72void fft_inplace(Array<T> &in, const int rank, const bool direction) {
73 verifySupported(rank, in.dims());
74 size_t tdims[AF_MAX_DIMS], istrides[AF_MAX_DIMS];
75
76 computeDims(tdims, in.dims());
77 computeDims(istrides, in.strides());
78
79 int batch = 1;
80 for (int i = rank; i < AF_MAX_DIMS; i++) { batch *= tdims[i]; }
81
82 SharedPlan plan = findPlan(
83 CLFFT_COMPLEX_INTERLEAVED, CLFFT_COMPLEX_INTERLEAVED,
84 static_cast<clfftDim>(rank), tdims, istrides, istrides[rank], istrides,
85 istrides[rank], static_cast<clfftPrecision>(Precision<T>::type), batch);
86
87 cl_mem imem = (*in.get())();
88 cl_command_queue queue = getQueue()();
89
90 CLFFT_CHECK(clfftEnqueueTransform(
91 *plan.get(), direction ? CLFFT_FORWARD : CLFFT_BACKWARD, 1, &queue, 0,
92 NULL, NULL, &imem, &imem, NULL));
93}
94
95template<typename Tc, typename Tr>
96Array<Tc> fft_r2c(const Array<Tr> &in, const int rank) {

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected