<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic DFT in Fortran Subroutine in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/DFT-in-Fortran-Subroutine/m-p/912647#M12266</link>
    <description>I've the following fortran code:
&lt;BR /&gt;
&lt;BR /&gt;	PROGRAM test
&lt;BR /&gt;           Use MKL_DFTI
&lt;BR /&gt;
&lt;BR /&gt;	IMPLICIT NONE
&lt;BR /&gt;	INTEGER, PARAMETER :: ngp=512
&lt;BR /&gt;	COMPLEX(16)		A(ngp)
&lt;BR /&gt;	INTEGER		i
&lt;BR /&gt;
&lt;BR /&gt;	DO i=1, ngp
&lt;BR /&gt;	   A(i)=i
&lt;BR /&gt;	ENDDO
&lt;BR /&gt;	
&lt;BR /&gt;	DO i=1,100
&lt;BR /&gt;	CALL transform(A,ngp)
&lt;BR /&gt;	ENDDO
&lt;BR /&gt;
&lt;BR /&gt;	END
&lt;BR /&gt;
&lt;BR /&gt;!=============================================================================
&lt;BR /&gt;
&lt;BR /&gt;	SUBROUTINE transform(A, ngp)
&lt;BR /&gt;          Use MKL_DFTI
&lt;BR /&gt;	IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;	INTEGER   ::    ngp
&lt;BR /&gt;	COMPLEX*16	A(ngp)
&lt;BR /&gt;	type(DFTI_DESCRIPTOR), POINTER :: punt
&lt;BR /&gt;	INTEGER		status
&lt;BR /&gt;                                    status=DftiCreateDescriptor(punt,DFTI_DOUBLE,DFTI_COMPLEX,1,ngp)
&lt;BR /&gt;       status=DftiCommitDescriptor(punt)
&lt;BR /&gt;
&lt;BR /&gt;	status=DftiComputeForward(punt,A)
&lt;BR /&gt;	status=DftiComputeBackward(punt,A)
&lt;BR /&gt;	A=A/ngp
&lt;BR /&gt;	status = DftiFreeDescriptor(punt)
&lt;BR /&gt;	END
&lt;BR /&gt;
&lt;BR /&gt;If instead of doing this I create and commit the descriptor in the main program, and then I pass the pointer "punt" to the subroutine I get a Segmentation Fault. Is there any way to create the descriptor just once in the program and use it every time I call the subroutine? or is this the only way to do it?
&lt;BR /&gt;</description>
    <pubDate>Fri, 17 Aug 2007 16:46:31 GMT</pubDate>
    <dc:creator>ajacobo</dc:creator>
    <dc:date>2007-08-17T16:46:31Z</dc:date>
    <item>
      <title>DFT in Fortran Subroutine</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/DFT-in-Fortran-Subroutine/m-p/912647#M12266</link>
      <description>I've the following fortran code:
&lt;BR /&gt;
&lt;BR /&gt;	PROGRAM test
&lt;BR /&gt;           Use MKL_DFTI
&lt;BR /&gt;
&lt;BR /&gt;	IMPLICIT NONE
&lt;BR /&gt;	INTEGER, PARAMETER :: ngp=512
&lt;BR /&gt;	COMPLEX(16)		A(ngp)
&lt;BR /&gt;	INTEGER		i
&lt;BR /&gt;
&lt;BR /&gt;	DO i=1, ngp
&lt;BR /&gt;	   A(i)=i
&lt;BR /&gt;	ENDDO
&lt;BR /&gt;	
&lt;BR /&gt;	DO i=1,100
&lt;BR /&gt;	CALL transform(A,ngp)
&lt;BR /&gt;	ENDDO
&lt;BR /&gt;
&lt;BR /&gt;	END
&lt;BR /&gt;
&lt;BR /&gt;!=============================================================================
&lt;BR /&gt;
&lt;BR /&gt;	SUBROUTINE transform(A, ngp)
&lt;BR /&gt;          Use MKL_DFTI
&lt;BR /&gt;	IMPLICIT NONE
&lt;BR /&gt;
&lt;BR /&gt;	INTEGER   ::    ngp
&lt;BR /&gt;	COMPLEX*16	A(ngp)
&lt;BR /&gt;	type(DFTI_DESCRIPTOR), POINTER :: punt
&lt;BR /&gt;	INTEGER		status
&lt;BR /&gt;                                    status=DftiCreateDescriptor(punt,DFTI_DOUBLE,DFTI_COMPLEX,1,ngp)
&lt;BR /&gt;       status=DftiCommitDescriptor(punt)
&lt;BR /&gt;
&lt;BR /&gt;	status=DftiComputeForward(punt,A)
&lt;BR /&gt;	status=DftiComputeBackward(punt,A)
&lt;BR /&gt;	A=A/ngp
&lt;BR /&gt;	status = DftiFreeDescriptor(punt)
&lt;BR /&gt;	END
&lt;BR /&gt;
&lt;BR /&gt;If instead of doing this I create and commit the descriptor in the main program, and then I pass the pointer "punt" to the subroutine I get a Segmentation Fault. Is there any way to create the descriptor just once in the program and use it every time I call the subroutine? or is this the only way to do it?
&lt;BR /&gt;</description>
      <pubDate>Fri, 17 Aug 2007 16:46:31 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/DFT-in-Fortran-Subroutine/m-p/912647#M12266</guid>
      <dc:creator>ajacobo</dc:creator>
      <dc:date>2007-08-17T16:46:31Z</dc:date>
    </item>
  </channel>
</rss>

