<?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 Re: MKL_F16 type in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-F16-type/m-p/1632276#M36446</link>
    <description>&lt;P&gt;The MKL_F16 datatype is defined in the public header mkl_types.h to be the same as "unsigned short" (we do some conversions internally) so when you are setting the initial matrix and alpha, beta you are not getting the numbers you expect.&lt;/P&gt;&lt;P&gt;The simplest way to fix this in your linked example is probably to use _Float16 as your working type:&lt;/P&gt;&lt;PRE&gt;run_gemm_example&amp;lt;_Float16&amp;gt;(m, k, n, repeat);&lt;/PRE&gt;&lt;P&gt;and then cast the pointers to MKL_F16 in the actual gemm call:&lt;/P&gt;&lt;PRE&gt; hgemm("N", "N", &amp;amp;n, &amp;amp;m, &amp;amp;k, (MKL_F16*) &amp;amp;alpha, (MKL_F16*) b, &amp;amp;n, (MKL_F16*) a, &amp;amp;k, (MKL_F16*) &amp;amp;beta, (MKL_F16*) c, &amp;amp;n);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 19 Sep 2024 19:00:05 GMT</pubDate>
    <dc:creator>Andrew_Barker</dc:creator>
    <dc:date>2024-09-19T19:00:05Z</dc:date>
    <item>
      <title>MKL_F16 type</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-F16-type/m-p/1628324#M36377</link>
      <description>&lt;P&gt;Can you please explain if MKL_F16 is equivalent to the 16-bit floating-point type (i.e. half) ?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Running the example does not produce the expected output for MKL_F16.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://github.com/zjin-lcf/HeCBench/tree/master/src/blas-gemm-omp" target="_blank"&gt;https://github.com/zjin-lcf/HeCBench/tree/master/src/blas-gemm-omp&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 03 Sep 2024 19:19:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-F16-type/m-p/1628324#M36377</guid>
      <dc:creator>zjin-lcf</dc:creator>
      <dc:date>2024-09-03T19:19:59Z</dc:date>
    </item>
    <item>
      <title>Re: MKL_F16 type</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-F16-type/m-p/1632276#M36446</link>
      <description>&lt;P&gt;The MKL_F16 datatype is defined in the public header mkl_types.h to be the same as "unsigned short" (we do some conversions internally) so when you are setting the initial matrix and alpha, beta you are not getting the numbers you expect.&lt;/P&gt;&lt;P&gt;The simplest way to fix this in your linked example is probably to use _Float16 as your working type:&lt;/P&gt;&lt;PRE&gt;run_gemm_example&amp;lt;_Float16&amp;gt;(m, k, n, repeat);&lt;/PRE&gt;&lt;P&gt;and then cast the pointers to MKL_F16 in the actual gemm call:&lt;/P&gt;&lt;PRE&gt; hgemm("N", "N", &amp;amp;n, &amp;amp;m, &amp;amp;k, (MKL_F16*) &amp;amp;alpha, (MKL_F16*) b, &amp;amp;n, (MKL_F16*) a, &amp;amp;k, (MKL_F16*) &amp;amp;beta, (MKL_F16*) c, &amp;amp;n);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Sep 2024 19:00:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/MKL-F16-type/m-p/1632276#M36446</guid>
      <dc:creator>Andrew_Barker</dc:creator>
      <dc:date>2024-09-19T19:00:05Z</dc:date>
    </item>
  </channel>
</rss>

