<?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 Optimization question in OpenCL* for CPU</title>
    <link>https://community.intel.com/t5/OpenCL-for-CPU/Optimization-question/m-p/790154#M596</link>
    <description>&lt;P&gt;In most of the cases the compiler will perform in-lining, hence there is no much differences.&lt;/P&gt;&lt;P&gt;If for some reason the compiler can't perform in-lining the following method is preferred.&lt;/P&gt;&lt;P&gt;float3 mymethod(float3,float3);&lt;/P&gt;&lt;P&gt;In any case, I advise you to use the "Offline compiler" tool and look for thex86 assembly.&lt;/P&gt;</description>
    <pubDate>Fri, 11 Mar 2011 07:29:16 GMT</pubDate>
    <dc:creator>Evgeny_F_Intel</dc:creator>
    <dc:date>2011-03-11T07:29:16Z</dc:date>
    <item>
      <title>Optimization question</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Optimization-question/m-p/790152#M594</link>
      <description>&lt;DIV&gt;I have a few question to know "how" I should write my methods. Can you tell me which one is the fast one ?&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;SPAN style="text-decoration: underline;"&gt;By example to pass values to a method :&lt;/SPAN&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;1 - Passing float3 by pointer&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt; void mymethod(float3* a, float3* b, float3* result)....&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="font-family: Verdana, Arial, Helvetica, sans-serif;"&gt;2 - Passing float3 directly&lt;BR /&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt; void mymethod(float3 a, float3 b, float3* result)....&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;3 - using "const" allowing the compiler to keep "a" and avoir a copy when entering into the method&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt; void mymethod(const float3 a, const float3 b, float3* result)....&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;B&gt;&lt;SPAN style="text-decoration: underline;"&gt;And to return values&lt;/SPAN&gt;&lt;/B&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;1 - By pointer&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt; void mymethod(float3* a, float3* b, float3* result)....&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt; float3 a;&lt;/DIV&gt;&lt;DIV&gt; mymethod(&amp;amp;a);&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;2 - By value&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt; float3 mymethod(float3* a, float3* b)....&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt; float3 a = mythod(...);&lt;/DIV&gt;</description>
      <pubDate>Thu, 03 Mar 2011 15:29:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Optimization-question/m-p/790152#M594</guid>
      <dc:creator>Polar01</dc:creator>
      <dc:date>2011-03-03T15:29:05Z</dc:date>
    </item>
    <item>
      <title>Optimization question</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Optimization-question/m-p/790153#M595</link>
      <description>Good questions. I'm also interestered in this!</description>
      <pubDate>Thu, 10 Mar 2011 00:10:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Optimization-question/m-p/790153#M595</guid>
      <dc:creator>jogshy</dc:creator>
      <dc:date>2011-03-10T00:10:32Z</dc:date>
    </item>
    <item>
      <title>Optimization question</title>
      <link>https://community.intel.com/t5/OpenCL-for-CPU/Optimization-question/m-p/790154#M596</link>
      <description>&lt;P&gt;In most of the cases the compiler will perform in-lining, hence there is no much differences.&lt;/P&gt;&lt;P&gt;If for some reason the compiler can't perform in-lining the following method is preferred.&lt;/P&gt;&lt;P&gt;float3 mymethod(float3,float3);&lt;/P&gt;&lt;P&gt;In any case, I advise you to use the "Offline compiler" tool and look for thex86 assembly.&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2011 07:29:16 GMT</pubDate>
      <guid>https://community.intel.com/t5/OpenCL-for-CPU/Optimization-question/m-p/790154#M596</guid>
      <dc:creator>Evgeny_F_Intel</dc:creator>
      <dc:date>2011-03-11T07:29:16Z</dc:date>
    </item>
  </channel>
</rss>

