<?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 ddot function returning single precision result in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ddot-function-returning-single-precision-result/m-p/979965#M17379</link>
    <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have the following function in a Fortran project (built in the Visual studio 2010 environment + Intel Compiler XE) that uses one of the MKL library functions (the ddot function that computes a vector-vector dot product):&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;function Calculate_Potential_Energy_From_Clusters(nb_clusters,Tetra_Mol_Array,Cluster_Pot_energy_Array)&lt;BR /&gt;&amp;nbsp;use Mod&lt;BR /&gt;&amp;nbsp;integer nb_clusters,n&lt;BR /&gt;&amp;nbsp;double precision Calculate_Potential_Energy_From_Clusters,Tetra_Mol_Array(nb_clusters),Cluster_Pot_energy_Array(nb_clusters)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; Calculate_Potential_Energy_From_Clusters=ddot(nb_clusters,Tetra_Mol_Array,1,Cluster_Pot_energy_Array,1)&lt;BR /&gt;&amp;nbsp; ... &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;end&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;The project is compiled without any error or warning...&lt;/P&gt;
&lt;P&gt;However, if I do not specify explicitly the type of the ddot function result, the MKL library return a single precision number (even if I specify the use of ddot, not sdot).&lt;/P&gt;
&lt;P&gt;I solved the problem by defining explicitly the type of ddot in my function:&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;function Calculate_Potential_Energy_From_Clusters(nb_clusters,Tetra_Mol_Array,Cluster_Pot_energy_Array)&lt;BR /&gt;&amp;nbsp;use Mod&lt;BR /&gt;&amp;nbsp;integer nb_clusters,n&lt;BR /&gt;&amp;nbsp;double precision &lt;B&gt;ddot&lt;/B&gt;, Calculate_Potential_Energy_From_Clusters,Tetra_Mol_Array(nb_clusters),Cluster_Pot_energy_Array(nb_clusters)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; Calculate_Potential_Energy_From_Clusters=ddot(nb_clusters,Tetra_Mol_Array,1,Cluster_Pot_energy_Array,1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;...&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;end&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;Is it normal that the intel XE compiler assumes that the result of the ddot function is of single precision when ddot function is not explicitly defined as a double precision number (ddot is supposed to return a double precision result)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, what should I do to avoid this problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
    <pubDate>Mon, 11 Nov 2013 22:49:04 GMT</pubDate>
    <dc:creator>jpharvey1981</dc:creator>
    <dc:date>2013-11-11T22:49:04Z</dc:date>
    <item>
      <title>ddot function returning single precision result</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ddot-function-returning-single-precision-result/m-p/979965#M17379</link>
      <description>&lt;P&gt;Hi everyone,&lt;/P&gt;
&lt;P&gt;I have the following function in a Fortran project (built in the Visual studio 2010 environment + Intel Compiler XE) that uses one of the MKL library functions (the ddot function that computes a vector-vector dot product):&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;function Calculate_Potential_Energy_From_Clusters(nb_clusters,Tetra_Mol_Array,Cluster_Pot_energy_Array)&lt;BR /&gt;&amp;nbsp;use Mod&lt;BR /&gt;&amp;nbsp;integer nb_clusters,n&lt;BR /&gt;&amp;nbsp;double precision Calculate_Potential_Energy_From_Clusters,Tetra_Mol_Array(nb_clusters),Cluster_Pot_energy_Array(nb_clusters)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; Calculate_Potential_Energy_From_Clusters=ddot(nb_clusters,Tetra_Mol_Array,1,Cluster_Pot_energy_Array,1)&lt;BR /&gt;&amp;nbsp; ... &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;end&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;The project is compiled without any error or warning...&lt;/P&gt;
&lt;P&gt;However, if I do not specify explicitly the type of the ddot function result, the MKL library return a single precision number (even if I specify the use of ddot, not sdot).&lt;/P&gt;
&lt;P&gt;I solved the problem by defining explicitly the type of ddot in my function:&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;&amp;nbsp;function Calculate_Potential_Energy_From_Clusters(nb_clusters,Tetra_Mol_Array,Cluster_Pot_energy_Array)&lt;BR /&gt;&amp;nbsp;use Mod&lt;BR /&gt;&amp;nbsp;integer nb_clusters,n&lt;BR /&gt;&amp;nbsp;double precision &lt;B&gt;ddot&lt;/B&gt;, Calculate_Potential_Energy_From_Clusters,Tetra_Mol_Array(nb_clusters),Cluster_Pot_energy_Array(nb_clusters)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&lt;BR /&gt;&amp;nbsp; Calculate_Potential_Energy_From_Clusters=ddot(nb_clusters,Tetra_Mol_Array,1,Cluster_Pot_energy_Array,1)&lt;BR /&gt;&amp;nbsp;&amp;nbsp;...&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;BR /&gt;&amp;nbsp;end&lt;/P&gt;
&lt;P&gt;*******************************************************************************************************************************************************&lt;/P&gt;
&lt;P&gt;Is it normal that the intel XE compiler assumes that the result of the ddot function is of single precision when ddot function is not explicitly defined as a double precision number (ddot is supposed to return a double precision result)?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If so, what should I do to avoid this problem?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thank you very much for your help!&lt;/P&gt;</description>
      <pubDate>Mon, 11 Nov 2013 22:49:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ddot-function-returning-single-precision-result/m-p/979965#M17379</guid>
      <dc:creator>jpharvey1981</dc:creator>
      <dc:date>2013-11-11T22:49:04Z</dc:date>
    </item>
    <item>
      <title>Quote:JPHarvey wrote:Is it</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ddot-function-returning-single-precision-result/m-p/979966#M17380</link>
      <description>&lt;P&gt;&lt;/P&gt;&lt;BLOCKQUOTE&gt;JPHarvey wrote:&lt;BR /&gt;Is it normal that the intel XE compiler assumes that the result of the ddot function is of single precision when ddot function is not explicitly defined as a double precision number&lt;/BLOCKQUOTE&gt;&lt;P&gt;&lt;/P&gt;
&lt;P&gt;This behavior is what the Fortran language rules prescribe, and is not specific to the Intel compiler.&lt;/P&gt;
&lt;P&gt;Any function that is not an intrinsic function has a type that is given by implicit typing rules. If you had declared IMPLICIT NONE in the subprogram where you invoked DDOT, the compiler would have complained that the variable/function did not have a declared type. In the absence of a type declaration, DDOT is a name beginning with a letter other than I, J, K, L, M, N and, therefore, of type real if IMPLICIT NONE has not been specified.&lt;/P&gt;</description>
      <pubDate>Tue, 12 Nov 2013 02:53:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/ddot-function-returning-single-precision-result/m-p/979966#M17380</guid>
      <dc:creator>mecej4</dc:creator>
      <dc:date>2013-11-12T02:53:24Z</dc:date>
    </item>
  </channel>
</rss>

