- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi ,I use the MKL DFT recently ,and use the forward DFT including one dimension and two dimensions without problem.
However, when I use the backward DFT, the result is zero !
I also study the examples in /opt/intel/mkl/examples/dft and the following is my test short code ,the result in my computer is zero.
I really can not find the problem in these short code and really need your help
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
#include <float.h>
#include "mkl_service.h"
#include "mkl_dfti.h"
#include "mkl.h"
#include<sys/time.h>
#define ALIGN_SIZE 64
#define REP_TIMES 1
int main()
{
#pragma offload target(mic:0)
{
MKL_LONG status = 0;
int dim[2];
dim[0]=20;dim[1]=20;
DFTI_DESCRIPTOR_HANDLE handle = 0;
MKL_Complex8 *in=(MKL_Complex8*)mkl_malloc(dim[0]*dim[1]*sizeof(MKL_Complex8),ALIGN_SIZE);
MKL_Complex8 *out=(MKL_Complex8*)mkl_malloc(dim[0]*dim[1]*sizeof(MKL_Complex8),ALIGN_SIZE);
for(int i=0;i<dim[0]*dim[1];i++)
{
in.real=i%100;
in.imag=0;
}
status = DftiCreateDescriptor(&handle, DFTI_SINGLE, DFTI_COMPLEX, 2, dim);
status =DftiSetValue( handle, DFTI_PLACEMENT, DFTI_NOT_INPLACE);
status = DftiCommitDescriptor(handle);
DftiComputeBackward(handle,in, out);
for(int i=0;i<10;i++)
{
printf("%f %f\n",out.real,out.imag);
}
}
}
And the output is :
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
0.000000 0.000000
Best Regards !
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please set type of dim as MKL_LONG, otherwise you could not create descriptor successfully. Thank you.
MKL_LONG dim[2];
Best regrads,
Fiona
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi,
Please set type of dim as MKL_LONG, otherwise you could not create descriptor successfully. Thank you.
MKL_LONG dim[2];
Best regrads,
Fiona
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Thank you very much! You are right.
Best regards !
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page