<?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 how aligned class data member, in Intel® ISA Extensions</title>
    <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799628#M598</link>
    <description>&lt;P&gt;could you please re-check your post?your question is somehow missing (or not displayed properly).&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2010 10:36:04 GMT</pubDate>
    <dc:creator>Nicolae_P_Intel</dc:creator>
    <dc:date>2010-10-27T10:36:04Z</dc:date>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799627#M597</link>
      <description>Hello All,&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;I am implemented a unlimited integer class, and I used SIMD to calculate basic operation + *.&lt;/DIV&gt;&lt;DIV&gt;At the beginning I developed a single kernel to test my code, and I declared and aligned my data&lt;/DIV&gt;&lt;DIV&gt;in the main by the &lt;SPAN style="line-height: 16px;"&gt;__attribute__((aligned(16))) command, it works. Now I am writing&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;a basic class, nevertheless the command&lt;/SPAN&gt;&lt;SPAN style="line-height: 16px;"&gt;__attribute__((aligned(16))) does not align (why) my array&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;and so the code crash when I run it.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;Any idea to align a basic array on 16 bytes boundary as data member of a class.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;Thanks&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;Tim&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN style="line-height: 16px;"&gt;&lt;P&gt;&lt;/P&gt;&lt;DIV id="_mcePaste"&gt;&lt;/DIV&gt;&lt;P&gt;&lt;/P&gt;&lt;/SPAN&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 27 Oct 2010 10:16:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799627#M597</guid>
      <dc:creator>Timocafe</dc:creator>
      <dc:date>2010-10-27T10:16:11Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799628#M598</link>
      <description>&lt;P&gt;could you please re-check your post?your question is somehow missing (or not displayed properly).&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 10:36:04 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799628#M598</guid>
      <dc:creator>Nicolae_P_Intel</dc:creator>
      <dc:date>2010-10-27T10:36:04Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799629#M599</link>
      <description>Done, I do not why it does not work the first time !</description>
      <pubDate>Wed, 27 Oct 2010 10:38:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799629#M599</guid>
      <dc:creator>Timocafe</dc:creator>
      <dc:date>2010-10-27T10:38:56Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799630#M600</link>
      <description>I find I make a typo on my kernel, sorry.</description>
      <pubDate>Wed, 27 Oct 2010 11:06:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799630#M600</guid>
      <dc:creator>Timocafe</dc:creator>
      <dc:date>2010-10-27T11:06:02Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799631#M601</link>
      <description>&lt;P&gt;can you share what typo have you find?&lt;BR /&gt;what compiler are you using and which platform? 64 or 32 bit?&lt;BR /&gt;what compiler options?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 13:52:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799631#M601</guid>
      <dc:creator>Nicolae_P_Intel</dc:creator>
      <dc:date>2010-10-27T13:52:37Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799632#M602</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;note that  __attribute__((aligned(16))) only works for allocation on the stack. When you allocate a type defined with that attribute on the heap (i.e. new/malloc) then the alignment restriction of the attribute does not apply. Instead you should rather use _mm_malloc with the correct alignment parameter.&lt;/P&gt;&lt;P&gt;It is possible to overload the new and delete operators of the class to achieve the desired effect automatically:&lt;/P&gt;&lt;P&gt;        void *operator new(size_t size) { return _mm_malloc(size, alignment); }&lt;/P&gt;&lt;P&gt;void *operator new[](size_t size) { return _mm_malloc(size, alignment); }&lt;/P&gt;&lt;P&gt;        void operator delete(void *ptr, size_t) { _mm_free(ptr); }&lt;/P&gt;&lt;P&gt;        void operator delete[](void *ptr, size_t) { _mm_free(ptr); }&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 19:47:38 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799632#M602</guid>
      <dc:creator>Matthias_Kretz</dc:creator>
      <dc:date>2010-10-27T19:47:38Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799633#M603</link>
      <description>Thank you very much for these informations, I did not know about __attribute__((aligned(16))) runs only in the stack. No problem to overload the operator, great solution !&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Thank you&lt;/DIV&gt;&lt;DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;Tim&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Oct 2010 12:11:02 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799633#M603</guid>
      <dc:creator>Timocafe</dc:creator>
      <dc:date>2010-10-29T12:11:02Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799634#M604</link>
      <description>By the way, if your platform is windows , use :&lt;BR /&gt;&lt;BR /&gt;&lt;H1 class="title"&gt;&lt;A href="http://msdn.microsoft.com/en-us/library/8z34s9c6%28VS.80%29.aspx"&gt;_aligned_malloc&lt;/A&gt; / &lt;A href="http://msdn.microsoft.com/en-us/library/17b5h8td%28VS.80%29.aspx"&gt;_aligned_free
&lt;/A&gt;        &lt;/H1&gt;&lt;BR /&gt;&lt;BR /&gt;to allocate aligned memory. &lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Fri, 19 Nov 2010 07:30:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799634#M604</guid>
      <dc:creator>Gaiger_Chen</dc:creator>
      <dc:date>2010-11-19T07:30:59Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799635#M605</link>
      <description>If you can use _mm_malloc, then please don't use windows specific API for the sake of portability. The only real standard way of allocating aligned memory on the heap probably is posix_memalign (sadly Windows doesn't offer POSIX compat per default, though). So using the _mm_ intrinsics probably comes closest to a portable standard...</description>
      <pubDate>Mon, 22 Nov 2010 18:16:53 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799635#M605</guid>
      <dc:creator>Matthias_Kretz</dc:creator>
      <dc:date>2010-11-22T18:16:53Z</dc:date>
    </item>
    <item>
      <title>how aligned class data member,</title>
      <link>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799636#M606</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;quick solution : use &lt;BR /&gt;&lt;BR /&gt;_mm_loadu_si128 / _mm_storeu_si128 &lt;BR /&gt;&lt;BR /&gt;to replase &lt;BR /&gt;&lt;BR /&gt;_mm_load_si128 and _mm_store_si128&lt;BR /&gt;&lt;BR /&gt;it should be pass.&lt;BR /&gt;&lt;BR /&gt;(the __attribute__((aligned(16))) could be remove also.)&lt;BR /&gt;</description>
      <pubDate>Fri, 24 Dec 2010 10:02:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-ISA-Extensions/how-aligned-class-data-member/m-p/799636#M606</guid>
      <dc:creator>Gaiger_Chen</dc:creator>
      <dc:date>2010-12-24T10:02:19Z</dc:date>
    </item>
  </channel>
</rss>

