<?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 MKL cblas_?gemv in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cblas-gemv/m-p/1076000#M22564</link>
    <description>&lt;P&gt;In the complex form of multiplying a matrix by a vector, namely the functions:&amp;nbsp;&lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_cgemv&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_zgemv&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;, what is the type of the parameters alpha and beta? The API for those functions requires a void*, so it is not clear what should be the type. Is it float/double for &lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_cgemv&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_zgemv&lt;/SPAN&gt;&amp;nbsp;respectively. Or maybe std::complex&amp;lt;float/double&amp;gt;? Mathematically a scalar can be defined as both a real or a complex number. So the description in the documentation of alpha and beta as scalars is not sufficient. I'm guessing this ambiguity can be found also in other functions throughout the MKL&lt;/P&gt;</description>
    <pubDate>Fri, 04 Nov 2016 17:38:30 GMT</pubDate>
    <dc:creator>Yaniv_H_1</dc:creator>
    <dc:date>2016-11-04T17:38:30Z</dc:date>
    <item>
      <title>MKL cblas_?gemv</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cblas-gemv/m-p/1076000#M22564</link>
      <description>&lt;P&gt;In the complex form of multiplying a matrix by a vector, namely the functions:&amp;nbsp;&lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_cgemv&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&amp;nbsp;and&amp;nbsp;&lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_zgemv&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;, what is the type of the parameters alpha and beta? The API for those functions requires a void*, so it is not clear what should be the type. Is it float/double for &lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_cgemv&lt;/SPAN&gt;&lt;SPAN style="color: rgb(102, 102, 102); font-family: Arial, Tahoma, Helvetica, sans-serif; font-size: 13px;"&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;and&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN class="kwd" style="box-sizing: border-box; font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; color: rgb(102, 102, 102); font-size: 13px;"&gt;cblas_zgemv&lt;/SPAN&gt;&amp;nbsp;respectively. Or maybe std::complex&amp;lt;float/double&amp;gt;? Mathematically a scalar can be defined as both a real or a complex number. So the description in the documentation of alpha and beta as scalars is not sufficient. I'm guessing this ambiguity can be found also in other functions throughout the MKL&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 17:38:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cblas-gemv/m-p/1076000#M22564</guid>
      <dc:creator>Yaniv_H_1</dc:creator>
      <dc:date>2016-11-04T17:38:30Z</dc:date>
    </item>
    <item>
      <title>Good question. </title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cblas-gemv/m-p/1076001#M22565</link>
      <description>&lt;P&gt;Good question.&amp;nbsp;&lt;/P&gt;

&lt;P&gt;alpha and beta apparently need to be compatible with Fortran.&amp;nbsp; I'd question whether the supplied headers are fully correct if they say void* rather than C99 complex data type pointers.&amp;nbsp; In cblas_cgemv it's a pointer to an array of 2 floats.&amp;nbsp; I guess this was done before there was much thought about consistent styles for C complex.&amp;nbsp; It's a reasonable assumption that a Fortran complex scalar reference is interoperable with a pointer to an array of 2 floats.&amp;nbsp; "It might be nice" if the cblas_gemv were updated to reconcile with Fortran 2003 where iso_c_binding specifies data types&lt;/P&gt;

&lt;P&gt;Fortran&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; C&lt;/P&gt;

&lt;P&gt;complex(c_float_complex)&amp;nbsp;&amp;nbsp; float _Complex&lt;/P&gt;

&lt;P&gt;complex(c_double_complex) double _Complex&lt;/P&gt;

&lt;P&gt;which in usual implementations would be effectively the same as the legacy cblas_?gemv scheme given that pointers are used consistently.&amp;nbsp; Also, in usual implementations c_float_complex==REAL32, c_double_complex==REAL64, but the std Fortran module would save you from making that assumption.&lt;/P&gt;

&lt;P&gt;As no one wants to mess with legacy C++ extern "C" in this respect, maybe we are stuck with the status quo.&amp;nbsp; Anyway, updates would require dealing with the maintainers of cblas.&amp;nbsp; Without such reconciliation, the cblas wrapper falls short in my view of the goal of rationalizing this interface, and we must look up the source to answer your question (and rely on the fact that MKL uses public source for this).&lt;/P&gt;</description>
      <pubDate>Fri, 04 Nov 2016 21:35:00 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-cblas-gemv/m-p/1076001#M22565</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2016-11-04T21:35:00Z</dc:date>
    </item>
  </channel>
</rss>

