Fix ifft placement bug

This commit is contained in:
kradchen
2023-06-13 14:36:34 +08:00
parent 46b4e5c04d
commit 98545c4bce

View File

@@ -13,6 +13,7 @@
#include <Eigen/Eigen> #include <Eigen/Eigen>
#include <Eigen/Dense> #include <Eigen/Dense>
#include <iterator> #include <iterator>
#include <mkl_dfti.h>
#include <utility> #include <utility>
using namespace Aurora; using namespace Aurora;
@@ -795,7 +796,7 @@ Matrix Aurora::ifft(const Matrix &aMatrix, long aFFTSize ) {
if (status != DFTI_NO_ERROR) goto error; if (status != DFTI_NO_ERROR) goto error;
//通过 setValue 配置Descriptor //通过 setValue 配置Descriptor
//使用单独的输出数据缓存 //使用单独的输出数据缓存
status = DftiSetValue(my_desc_handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE); status = DftiSetValue(my_desc_handle, DFTI_PLACEMENT, DFTI_INPLACE);
if (status != DFTI_NO_ERROR) goto error; if (status != DFTI_NO_ERROR) goto error;
//设置DFTI_BACKWARD_SCALE !!!很关键,不然值不对 //设置DFTI_BACKWARD_SCALE !!!很关键,不然值不对
@@ -821,7 +822,7 @@ Matrix Aurora::ifft(const Matrix &aMatrix, long aFFTSize ) {
if (status != DFTI_NO_ERROR) goto error; if (status != DFTI_NO_ERROR) goto error;
//执行计算 //执行计算
status = DftiComputeBackward(my_desc_handle, aMatrix.getData(), output); status = DftiComputeBackward(my_desc_handle, output, output);
if (status != DFTI_NO_ERROR) goto error; if (status != DFTI_NO_ERROR) goto error;
//释放资源 //释放资源
status = DftiFreeDescriptor(&my_desc_handle); status = DftiFreeDescriptor(&my_desc_handle);