<?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 Strange error doing 2-d convolution in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-error-doing-2-d-convolution/m-p/906335#M11739</link>
    <description>&lt;P&gt;Hi, I'm attempting to do a 2-d convolution of a 1024x1024 array with a 3x3 kernel with 1024x1024 output. The vslsConvNewTask returns a status of 0, indicating the task was created successfully. However, vslsConvExec returns a status of 1048576, which isn't even a valid error code as far as I can find. I have tried running the convolution under the direct, fft, and auto modes and they all return the same result. Here's what the code itself looks like:&lt;/P&gt;
&lt;P&gt;dims = 2;&lt;BR /&gt;xstride=1;&lt;BR /&gt;mode = &lt;FONT size="2"&gt;VSL_CONV_MODE_AUTO&lt;BR /&gt;&lt;/FONT&gt;status = vslsConvNewTask(&amp;amp;task, mode, dims, xShape, yShape, zShape);&lt;BR /&gt;status2 = vslsConvExec(&amp;amp;task, input, xstride, kernel, xstride, output, xstride);&lt;/P&gt;
&lt;P&gt;The code executes, but my output is an array of all 0s and I get the strange status code from vslsConvExec. I'm really at a loss to understand what's happening &lt;/P&gt;</description>
    <pubDate>Thu, 12 Oct 2006 02:05:28 GMT</pubDate>
    <dc:creator>greg_knoke</dc:creator>
    <dc:date>2006-10-12T02:05:28Z</dc:date>
    <item>
      <title>Strange error doing 2-d convolution</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-error-doing-2-d-convolution/m-p/906335#M11739</link>
      <description>&lt;P&gt;Hi, I'm attempting to do a 2-d convolution of a 1024x1024 array with a 3x3 kernel with 1024x1024 output. The vslsConvNewTask returns a status of 0, indicating the task was created successfully. However, vslsConvExec returns a status of 1048576, which isn't even a valid error code as far as I can find. I have tried running the convolution under the direct, fft, and auto modes and they all return the same result. Here's what the code itself looks like:&lt;/P&gt;
&lt;P&gt;dims = 2;&lt;BR /&gt;xstride=1;&lt;BR /&gt;mode = &lt;FONT size="2"&gt;VSL_CONV_MODE_AUTO&lt;BR /&gt;&lt;/FONT&gt;status = vslsConvNewTask(&amp;amp;task, mode, dims, xShape, yShape, zShape);&lt;BR /&gt;status2 = vslsConvExec(&amp;amp;task, input, xstride, kernel, xstride, output, xstride);&lt;/P&gt;
&lt;P&gt;The code executes, but my output is an array of all 0s and I get the strange status code from vslsConvExec. I'm really at a loss to understand what's happening &lt;/P&gt;</description>
      <pubDate>Thu, 12 Oct 2006 02:05:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-error-doing-2-d-convolution/m-p/906335#M11739</guid>
      <dc:creator>greg_knoke</dc:creator>
      <dc:date>2006-10-12T02:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Strange error doing 2-d convolution</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-error-doing-2-d-convolution/m-p/906336#M11740</link>
      <description>&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;Greg,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;Please excuse me for the long delay; Ive overlooked your request.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;About that piece of code you provide, I see two points which must cause C/C++ compiler to raise warnings.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;First, the function vslsConvExec() expects the 1&lt;SUP&gt;st&lt;/SUP&gt; parameter to be VSLConvTaskPtr, not the reference to VSLConvTaskPtr. That is, you need to replace the call:&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;status2 = vslsConvExec(&amp;amp;task, );&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;with:&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;status2 = vslsConvExec(task, );&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;Second, the functions vslsConvNewTask() and vslsConvExec() expect the shape and stride parameters to be integer arrays of the type int[], not scalars. In your example, the code might look like following:&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int xShape[] = {1024,1024};&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int yShape[] = {3,3};&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int zShape[] = {1026,1026}; // 1026 = 1024 + 3 - 1&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int mode = VSL_CONV_MODE_AUTO;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int dims = 2;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;VSLConvTaskPtr task;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int status = vslsConvNewTask(&amp;amp;task, mode, dims, xShape, yShape, zShape);&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int staus2 = vslsConvExec(task, input, NULL, kernel, NULL, output, NULL);&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;The NULL arrays instead of stride parameters cause MKL to process the da
ta arrays with trivial strides. If you prefer assigning the strides explicitly, the code modification might look like following:&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int xStride[] = {1,1024};&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int yStride[] = {1,3};&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int zStride[] = {1,1026};&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt 35.4pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;int staus2 = vslsConvExec(task, input, zStride, kernel, yStride, output, zStride);&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;I hope these hints must help. Anyway, please let me know (via this Forum thread) if you have more questions about the MKL convolution and correlation software.&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;Thanks,&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;Yevgeny Latkin&lt;/SPAN&gt;&lt;/P&gt;
&lt;P class="MsoNormal" style="MARGIN: 0in 0in 0pt"&gt;&lt;SPAN style="mso-ansi-language: EN-US"&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 16 Dec 2006 18:13:08 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Strange-error-doing-2-d-convolution/m-p/906336#M11740</guid>
      <dc:creator>Yevgeny_Latkin__Inte</dc:creator>
      <dc:date>2006-12-16T18:13:08Z</dc:date>
    </item>
  </channel>
</rss>

