Intel® oneAPI Math Kernel Library
Ask questions and share information with other developers who use Intel® Math Kernel Library.

about 2D FFT

Dawn_L_
Beginner
795 Views

 

    Hi,

      Below is a block of codes for using 2D FFT from MKL:

         MKL_LONG      flen1[2]={nffty,nfftx};    
         MKL_LONG      status;
    
         DFTI_DESCRIPTOR_HANDLE      hand1;  
         status=DftiCreateDescriptor(&hand1,DFTI_SINGLE,DFTI_COMPLEX,2,flen1); 
         status=DftiCommitDescriptor(hand1);                 
         status=DftiComputeForward(hand1,tmp); 
         
         tmp is a 2D complex array.
         
         problems:
                               
         tmp in DftiComputeForward: if tmp is given by tmp[ ][ ] the compiling can go through and the block codes works well. If tmp is given by **tmp and alloc memory to it, the compiling can go through but executing is crushed at DftiComputeForward.
            
          So, the problem is in/out parameter in DftiComputeForward has to be hard-coding 2D array and cannot be pointer type?

        Any answer is welcomed. Thank you very much.

 

 

 

0 Kudos
3 Replies
Dmitry_B_Intel
Employee
795 Views

You are correct, the i/o pointers should point directly to the data, not to the pointers to the rows/columns. See also what FFTW3 documentation says on this.

Thanks
Dima

0 Kudos
Dawn_L_
Beginner
795 Views

   

   Thank you, Dima, for your reply.

   Same block code with different problem as below:

   complex       tmp[nffty][nfftx],swap[nffty][nfftx];
    
    MKL_LONG      flen1[2]; 
    flen1[0]=nffty; 
    flen1[1]=nfftx; 
    
    MKL_LONG      status;
    
    DFTI_DESCRIPTOR_HANDLE      hand1;  
    status=DftiCreateDescriptor(&hand1,DFTI_SINGLE,DFTI_COMPLEX,2,flen1); 
    status=DftiCommitDescriptor(hand1);                    
    status=DftiComputeForward(hand1,tmp);     

   Problem: If I define nffty=1024 and nfftx=1024, the executing of program is crushed at  "complex   tmp[nffty][nfftx],swap[nffty][nfftx];"

   Do you think there is size limitation for 2D complex array of tmp and swap?

 

   Thank you very much in advanced.

 

 

0 Kudos
Evgueni_P_Intel
Employee
795 Views

Yes, 16 megabytes exceed the typical size of thread stack.

Try allocating the arrays at run time or extend the size of stack using an appropriate compiler switch.

0 Kudos
Reply