<?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 IPP and CPU-optimized Code on mulit-core in Intel® Integrated Performance Primitives</title>
    <link>https://community.intel.com/t5/Intel-Integrated-Performance/IPP-and-CPU-optimized-Code-on-mulit-core/m-p/871386#M8954</link>
    <description>&lt;P&gt;As everyone know, IPP is optimized for the broad range of Intel microprocessors:Intel Core&lt;SUP&gt;TM&lt;/SUP&gt;2 Quad processors, Intel Core&lt;SUP&gt;TM&lt;/SUP&gt; 2 Duo Processors, Intel Xeon processors, Intel Pentium 4 processor and the Intel Itanium 2 processors.Some quick questions may arise&lt;BR /&gt;&lt;BR /&gt;1. how to make IPP function run with cpu_optimized code. &lt;BR /&gt;First, let's understand what is cpu_optimized code.&lt;BR /&gt;&lt;BR /&gt;ippsCopy_8u ( ... ) &lt;BR /&gt;{ switch ( detected_processor_feature ) &lt;BR /&gt; {&lt;/P&gt;
&lt;P&gt; case SSE4.1:&lt;/P&gt;
&lt;P&gt; returnv8_ippsCopy_8u ( ... );&lt;/P&gt;
&lt;P&gt; case SSE3: &lt;BR /&gt; return t7_ippsCopy_8u ( ... ); &lt;BR /&gt; case SSE2: &lt;BR /&gt; return w7_ippsCopy_8u ( ... );&lt;BR /&gt; default: return px_ippsCopy_8u ( ... );&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;BR /&gt;here the "v8","t7", "w7" are cpu-optimized Code. Please see more from&lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-understanding-cpu-optimized-code-used-in-intel-ipp/"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-understanding-cpu-optimized-code-used-in-intel-ipp/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thensomeof usmay consider the following question what cpu-optimized code should we use? Should we detect the cpu type first?&lt;/P&gt;
&lt;P&gt;If youtake look at the code in detial, you willfindthe code "switch ( detected_processor_feature )" . It is cpu type detect code. Actually, IPP can automatically detect CPU type and dispatch the corresponding cpu_optimized codeat run-time.  So from user of point of view, you don'tneedworry aboutwhat cpu-optimized codeyou should use. IPP will dothese for you automatically.&lt;/P&gt;
&lt;P&gt;Please notes, if you are linking static IPP library, for exmaple, ippiemerged.lib ippimerged.lib, please callippStaticInit() at the begining of your code.&lt;/P&gt;
&lt;P&gt;If you are linking Dynamic IPP library, then no thing need to do .&lt;/P&gt;
&lt;P&gt;To know how to link IPP , please see&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/using-ipp-in-msvc2008/"&gt;http://software.intel.com/en-us/articles/using-ipp-in-msvc2008/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/how-to-build-ipp-application/"&gt;http://software.intel.com/en-us/articles/how-to-build-ipp-application/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. How to know the CPU type and which CPU-optimized code the IPP function will run&lt;/P&gt;
&lt;P&gt;If you'd like to know what CPU type and which CPU-optimized code you machine are using.You can easily runany of exe fileunder &lt;IPPINSTALL dir=""&gt;\tools\perfsys, then you will see the message as below&lt;/IPPINSTALL&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;+-----------------------------------------------------------------------------+&lt;BR /&gt;| CPU : Intel Core 2 Duo processor, 2x2 GHz, Max cache size 4096 K|&lt;BR /&gt;| OS : Microsoft Windows XP Service Pack 3 (Win32) |&lt;BR /&gt;| Computer : YHU5-MOBL |&lt;BR /&gt;| Library : ippacv8-6.1.dll, 6.1 build 137.15, Apr 10 2009 |&lt;BR /&gt;| Test : Timing |&lt;BR /&gt;| Mon Sep 14 15:06:25 2009|&lt;BR /&gt;+-----------------------------------------------------------------------------+&lt;/P&gt;
&lt;P&gt;My machine is running IPP "v8" code and CPU type is Core 2 Duo Processor, 2x2GHZ.&lt;/P&gt;
&lt;P&gt;3. How to use only one special CPU-optimized code for my machine&lt;/P&gt;
&lt;P&gt;IPP provide one function ippInitCpu ()&lt;/P&gt;
&lt;P&gt;Initializes the version of the library code for the specified processor type.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Call it if your exe will run on only one kind of processor.&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;see the section : single processor static dispath at&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-intel-ipp-linkage-models-quick-reference-guide/"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-intel-ipp-linkage-models-quick-reference-guide/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;4. how to run IPP function on Multi-core.&lt;/P&gt;
&lt;P&gt;It is another big topic regarding IPP threading feature. We may talk it next time. If you are interested in these, please refer to&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-threading-openmp-faq/"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-threading-openmp-faq/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/limiting-the-number-of-cores-of-execution-on-a-windows-system/"&gt;&lt;B&gt;Limiting the Number of Cores of Execution on a Windows System&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/limiting-the-number-of-cores-of-execution-on-a-windows-system/"&gt;http://software.intel.com/en-us/articles/limiting-the-number-of-cores-of-execution-on-a-windows-system/&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Sep 2009 07:57:52 GMT</pubDate>
    <dc:creator>Ying_H_Intel</dc:creator>
    <dc:date>2009-09-14T07:57:52Z</dc:date>
    <item>
      <title>IPP and CPU-optimized Code on mulit-core</title>
      <link>https://community.intel.com/t5/Intel-Integrated-Performance/IPP-and-CPU-optimized-Code-on-mulit-core/m-p/871386#M8954</link>
      <description>&lt;P&gt;As everyone know, IPP is optimized for the broad range of Intel microprocessors:Intel Core&lt;SUP&gt;TM&lt;/SUP&gt;2 Quad processors, Intel Core&lt;SUP&gt;TM&lt;/SUP&gt; 2 Duo Processors, Intel Xeon processors, Intel Pentium 4 processor and the Intel Itanium 2 processors.Some quick questions may arise&lt;BR /&gt;&lt;BR /&gt;1. how to make IPP function run with cpu_optimized code. &lt;BR /&gt;First, let's understand what is cpu_optimized code.&lt;BR /&gt;&lt;BR /&gt;ippsCopy_8u ( ... ) &lt;BR /&gt;{ switch ( detected_processor_feature ) &lt;BR /&gt; {&lt;/P&gt;
&lt;P&gt; case SSE4.1:&lt;/P&gt;
&lt;P&gt; returnv8_ippsCopy_8u ( ... );&lt;/P&gt;
&lt;P&gt; case SSE3: &lt;BR /&gt; return t7_ippsCopy_8u ( ... ); &lt;BR /&gt; case SSE2: &lt;BR /&gt; return w7_ippsCopy_8u ( ... );&lt;BR /&gt; default: return px_ippsCopy_8u ( ... );&lt;BR /&gt;}&lt;/P&gt;
&lt;P&gt;}&lt;BR /&gt;here the "v8","t7", "w7" are cpu-optimized Code. Please see more from&lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-understanding-cpu-optimized-code-used-in-intel-ipp/"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-understanding-cpu-optimized-code-used-in-intel-ipp/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Thensomeof usmay consider the following question what cpu-optimized code should we use? Should we detect the cpu type first?&lt;/P&gt;
&lt;P&gt;If youtake look at the code in detial, you willfindthe code "switch ( detected_processor_feature )" . It is cpu type detect code. Actually, IPP can automatically detect CPU type and dispatch the corresponding cpu_optimized codeat run-time.  So from user of point of view, you don'tneedworry aboutwhat cpu-optimized codeyou should use. IPP will dothese for you automatically.&lt;/P&gt;
&lt;P&gt;Please notes, if you are linking static IPP library, for exmaple, ippiemerged.lib ippimerged.lib, please callippStaticInit() at the begining of your code.&lt;/P&gt;
&lt;P&gt;If you are linking Dynamic IPP library, then no thing need to do .&lt;/P&gt;
&lt;P&gt;To know how to link IPP , please see&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/using-ipp-in-msvc2008/"&gt;http://software.intel.com/en-us/articles/using-ipp-in-msvc2008/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/how-to-build-ipp-application/"&gt;http://software.intel.com/en-us/articles/how-to-build-ipp-application/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;2. How to know the CPU type and which CPU-optimized code the IPP function will run&lt;/P&gt;
&lt;P&gt;If you'd like to know what CPU type and which CPU-optimized code you machine are using.You can easily runany of exe fileunder &lt;IPPINSTALL dir=""&gt;\tools\perfsys, then you will see the message as below&lt;/IPPINSTALL&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;+-----------------------------------------------------------------------------+&lt;BR /&gt;| CPU : Intel Core 2 Duo processor, 2x2 GHz, Max cache size 4096 K|&lt;BR /&gt;| OS : Microsoft Windows XP Service Pack 3 (Win32) |&lt;BR /&gt;| Computer : YHU5-MOBL |&lt;BR /&gt;| Library : ippacv8-6.1.dll, 6.1 build 137.15, Apr 10 2009 |&lt;BR /&gt;| Test : Timing |&lt;BR /&gt;| Mon Sep 14 15:06:25 2009|&lt;BR /&gt;+-----------------------------------------------------------------------------+&lt;/P&gt;
&lt;P&gt;My machine is running IPP "v8" code and CPU type is Core 2 Duo Processor, 2x2GHZ.&lt;/P&gt;
&lt;P&gt;3. How to use only one special CPU-optimized code for my machine&lt;/P&gt;
&lt;P&gt;IPP provide one function ippInitCpu ()&lt;/P&gt;
&lt;P&gt;Initializes the version of the library code for the specified processor type.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;Call it if your exe will run on only one kind of processor.&lt;/P&gt;
&lt;P&gt;Or&lt;/P&gt;
&lt;P&gt;see the section : single processor static dispath at&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-intel-ipp-linkage-models-quick-reference-guide/"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-intel-ipp-linkage-models-quick-reference-guide/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;4. how to run IPP function on Multi-core.&lt;/P&gt;
&lt;P&gt;It is another big topic regarding IPP threading feature. We may talk it next time. If you are interested in these, please refer to&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-threading-openmp-faq/"&gt;http://software.intel.com/en-us/articles/intel-integrated-performance-primitives-intel-ipp-threading-openmp-faq/&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;and&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/limiting-the-number-of-cores-of-execution-on-a-windows-system/"&gt;&lt;B&gt;Limiting the Number of Cores of Execution on a Windows System&lt;/B&gt;&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="http://software.intel.com/en-us/articles/limiting-the-number-of-cores-of-execution-on-a-windows-system/"&gt;http://software.intel.com/en-us/articles/limiting-the-number-of-cores-of-execution-on-a-windows-system/&lt;/A&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Sep 2009 07:57:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Integrated-Performance/IPP-and-CPU-optimized-Code-on-mulit-core/m-p/871386#M8954</guid>
      <dc:creator>Ying_H_Intel</dc:creator>
      <dc:date>2009-09-14T07:57:52Z</dc:date>
    </item>
  </channel>
</rss>

