<?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 Hi, in Intel® oneAPI Math Kernel Library</title>
    <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122090#M25023</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yep, thanks, that's what I ended up doing.&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;Wasted whole evening trying to export&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;some functions in ipps.h as stdcall to a custom dll... &amp;nbsp;But then realized stdcall is default in IPP... Is it?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;In MKL its cdecl (though most functions have stdcall)?&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;MK&lt;/P&gt;</description>
    <pubDate>Tue, 11 Apr 2017 09:07:06 GMT</pubDate>
    <dc:creator>Mikhail_K_</dc:creator>
    <dc:date>2017-04-11T09:07:06Z</dc:date>
    <item>
      <title>Element-wise vector comparison</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122088#M25021</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have a huge mxn matrix A where I need to compute A(i,j) &amp;gt; 0, ie. 1 for all values which are positive, and 0 otherwise&lt;/P&gt;

&lt;P&gt;I would be better off writing it in C++, but let's assume I'm in a situation where I don't have admin rights and cannot install/compile anything. I'm using a single-threaded scripting language (VBA) to wrap calls to mkl_rt.dll, and any combination of MKL functions is still faster.&lt;/P&gt;

&lt;P&gt;One way to solve this is to compute 1-0^(x+abs(x)), ie something like&lt;/P&gt;

&lt;P&gt;&amp;nbsp; &amp;nbsp; vdabs m*n, A(1, 1), temp(1, 1)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; vdadd &lt;SPAN style="font-size: 13.008px;"&gt;m*n&lt;/SPAN&gt;, A(1, 1), temp(1, 1), temp(1, 1)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; vdpow &lt;SPAN style="font-size: 13.008px;"&gt;m*n&lt;/SPAN&gt;, res(1, 1), temp(1, 1), res(1, 1) &amp;nbsp;/***** (res() is an array full of zeros)&lt;BR /&gt;
	&amp;nbsp; &amp;nbsp; vdlinearfrac &lt;SPAN style="font-size: 13.008px;"&gt;m*n&lt;/SPAN&gt;, res(1, 1), res(1, 1), 0, -1, 0, 1, res(1, 1)&lt;/P&gt;

&lt;P&gt;But the vdpow function is quite costly computation-wise (overall speed difference is ca x4 in favor of mkl, but I expect more from one single thread in VBA vs compiled multi-threaded code)&lt;/P&gt;

&lt;P&gt;Another solution is to find the maximum value in the array, divide by max+1 to force all values into &amp;lt;-1, 1&amp;gt; and apply &lt;SPAN style="color: rgb(102, 102, 102); font-family: &amp;quot;Courier New&amp;quot;, Courier, monospace; font-size: 13px;"&gt;vdceil&lt;/SPAN&gt;, &amp;lt;-1, 0] becomes 0, and &amp;lt;0, 1&amp;gt; becomes 1, but there can be some problems if the numbers are huge and end up as [-1, 1]&lt;/P&gt;

&lt;P&gt;&lt;SPAN style="font-size: 1em;"&gt;Can anyone think of a simpler way to do it?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Mar 2017 15:50:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122088#M25021</guid>
      <dc:creator>Mikhail_K_</dc:creator>
      <dc:date>2017-03-17T15:50:54Z</dc:date>
    </item>
    <item>
      <title>Hi Mikhail,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122089#M25022</link>
      <description>&lt;P&gt;Hi Mikhail,&lt;/P&gt;

&lt;P&gt;It seems no simple function in MKL can do such operation&lt;/P&gt;

&lt;P&gt;If possible, could you use other library like IPP library, which can do such operation by one function&lt;/P&gt;

&lt;P&gt;for example&lt;/P&gt;

&lt;P&gt;&lt;FONT size="2"&gt;&lt;SPAN class="fontstyle0"&gt;&lt;STRONG&gt;Conversion of a grayscale image to a bitonal image&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;BR /&gt;
	&lt;SPAN class="fontstyle2"&gt;IppStatus ippiGrayToBin_&amp;lt;srcDataType&amp;gt;1u_C1R&amp;nbsp; (please search IPP's developer guide)&lt;/SPAN&gt;&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;&lt;SPAN class="fontstyle0"&gt;&lt;FONT size="2"&gt;ippiThreshold_GTVal&amp;nbsp; etc. &lt;/FONT&gt;&lt;/SPAN&gt;&lt;/P&gt;

&lt;P&gt;&lt;FONT size="2"&gt;You mentioned you can't compile on one machine,&amp;nbsp; Could it possible for you to wrap IPP dll on other machine with admin right , then copy the dll to VBA, thus you can use IPP dll?&lt;/FONT&gt;&lt;/P&gt;

&lt;P&gt;Best Regards,&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Mon, 27 Mar 2017 01:19:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122089#M25022</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2017-03-27T01:19:11Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122090#M25023</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Yep, thanks, that's what I ended up doing.&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;Wasted whole evening trying to export&lt;SPAN style="font-size: 13.008px;"&gt;&amp;nbsp;some functions in ipps.h as stdcall to a custom dll... &amp;nbsp;But then realized stdcall is default in IPP... Is it?&lt;/SPAN&gt;&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;In MKL its cdecl (though most functions have stdcall)?&lt;/P&gt;

&lt;P style="font-size: 13.008px;"&gt;MK&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2017 09:07:06 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122090#M25023</guid>
      <dc:creator>Mikhail_K_</dc:creator>
      <dc:date>2017-04-11T09:07:06Z</dc:date>
    </item>
    <item>
      <title>By the way, why are multi</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122091#M25024</link>
      <description>&lt;P&gt;By the way, why are multi-threaded vector arithmetic functions (like ippsMul_64f) depreciated in IPP, but its seemingly ok to have multi-threaded &lt;SPAN style="font-size: 13.008px;"&gt;vdMul&lt;/SPAN&gt;&amp;nbsp;in MKL?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2017 09:59:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122091#M25024</guid>
      <dc:creator>Mikhail_K_</dc:creator>
      <dc:date>2017-04-12T09:59:48Z</dc:date>
    </item>
    <item>
      <title>&gt;&gt;...</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122092#M25025</link>
      <description>&amp;gt;&amp;gt;...
&amp;gt;&amp;gt;...stdcall is default in IPP... Is it?

Yes for Windows  platforms. ( It is not clear what platform you're using / I think Windows... )

&lt;STRONG&gt;[ ippdefs.h ]&lt;/STRONG&gt;
...
#if defined( _WIN32 ) || defined ( _WIN64 )
  #define &lt;STRONG&gt;__STDCALL&lt;/STRONG&gt;  &lt;STRONG&gt;__stdcall&lt;/STRONG&gt;
  #define __CDECL    __cdecl
  #define __INT64    __int64
  #define __UINT64    unsigned __int64
#else
  #define __STDCALL
  #define __CDECL
  #define __INT64    long long
  #define __UINT64    unsigned long long
#endif


#if !defined( IPPAPI )

  #if defined( IPP_W32DLL ) &amp;amp;&amp;amp; (defined( _WIN32 ) || defined( _WIN64 ))
    #if defined( _MSC_VER ) || defined( __ICL )
      #define IPPAPI( type,name,arg ) \
                     __declspec(dllimport)   type &lt;STRONG&gt;__STDCALL&lt;/STRONG&gt; name arg;
    #else
      #define IPPAPI( type,name,arg )        type &lt;STRONG&gt;__STDCALL&lt;/STRONG&gt; name arg;
    #endif
  #else
    #define   IPPAPI( type,name,arg )        type &lt;STRONG&gt;__STDCALL&lt;/STRONG&gt; name arg;
  #endif

#endif
...</description>
      <pubDate>Thu, 13 Apr 2017 22:49:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122092#M25025</guid>
      <dc:creator>SergeyKostrov</dc:creator>
      <dc:date>2017-04-13T22:49:15Z</dc:date>
    </item>
    <item>
      <title>Hi MK, Sergey,</title>
      <link>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122093#M25026</link>
      <description>&lt;P&gt;Hi MK, Sergey,&lt;/P&gt;

&lt;P&gt;Yes, IPP custom dll is using default stdcall.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Ying&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2017 01:39:15 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-oneAPI-Math-Kernel-Library/Element-wise-vector-comparison/m-p/1122093#M25026</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2017-04-17T01:39:15Z</dc:date>
    </item>
  </channel>
</rss>

