<?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 Re: Identify Pentium 4 Processor is supporting HT in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993718#M6311</link>
    <description>hi,&lt;BR /&gt;&lt;BR /&gt;I have attached the sample source code. Well I did include the header excpt.h but somehow is not working on Linux platform. &lt;BR /&gt;&lt;BR /&gt;Is there a way that i do not need the Intel Compiler C++ to compile on Linux? &lt;BR /&gt;&lt;BR /&gt;I need to write a code on detecting the HT support in my project which is running on Linux.&lt;BR /&gt;&lt;BR /&gt;Please help!&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;-yau-</description>
    <pubDate>Wed, 23 Mar 2005 09:28:20 GMT</pubDate>
    <dc:creator>yaumeileng</dc:creator>
    <dc:date>2005-03-23T09:28:20Z</dc:date>
    <item>
      <title>Identify Pentium 4 Processor is supporting HT</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993715#M6308</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;I have come accross on the training material online regarding on how to determine is the processor is supporting on HT. I have copied the sample code given and run it on RedHat 9.0 on a Pentium 4 PC. here is the sample code;&lt;BR /&gt;&lt;BR /&gt;===================================================&lt;BR /&gt;#define HT_BIT 0x10000000 // EDX[28] - Bit 28 set indicates&lt;BR /&gt;// Hyper-Threading Technology is supported&lt;BR /&gt;// in hardware.&lt;BR /&gt;#define FAMILY_ID 0x0f00 // EAX[11:8] - Bit 11 thru 8 contains family&lt;BR /&gt;// processor id&lt;BR /&gt;#define EXT_FAMILY_ID 0x0f00000 // EAX[23:20] - Bit 23 thru 20 contains&lt;BR /&gt;// extended family processor id&lt;BR /&gt;#define PENTIUM4_ID 0x0f00 // Pentium 4 family processor id&lt;BR /&gt;// Returns non-zero if Hyper-Threading Technology is supported on&lt;BR /&gt;// the processors and zero if not. This does not mean that&lt;BR /&gt;// Hyper-Threading Technology is necessarily enabled.&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;unsigned int HTSupported(void)&lt;BR /&gt;{&lt;BR /&gt;unsigned int reg_eax = 0;&lt;BR /&gt;unsigned int reg_edx = 0;&lt;BR /&gt;unsigned int vendor_id[3] = {0, 0, 0};&lt;BR /&gt;__try { // verify cpuid instruction is supported&lt;BR /&gt;__asm {&lt;BR /&gt;xor eax, eax // call cpuid with eax = 0&lt;BR /&gt;cpuid // get vendor id string&lt;BR /&gt;mov vendor_id, ebx&lt;BR /&gt;mov vendor_id + 4, edx&lt;BR /&gt;mov vendor_id + 8, ecx&lt;BR /&gt;mov eax, 1 // call cpuid with eax = 1&lt;BR /&gt;cpuid&lt;BR /&gt;mov reg_eax, eax // eax contains cpu family type info&lt;BR /&gt;mov reg_edx, edx // edx has info whether Hyper-Threading&lt;BR /&gt;// Technology is available&lt;BR /&gt;}&lt;BR /&gt;}&lt;BR /&gt;__except (EXCEPTION_EXECUTE_HANDLER ) {&lt;BR /&gt;return 0; // CPUID is not supported and so Hyper-Threading Technology&lt;BR /&gt;// is not supported&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;// Check to see if this is a Pentium 4 or later processor&lt;BR /&gt;if (((reg_eax &amp;amp; FAMILY_ID) == PENTIUM4_ID) || (reg_eax &amp;amp; EXT_FAMILY_ID))&lt;BR /&gt;if (vendor_id[0] == 'uneG')&lt;BR /&gt;if (vendor_id[1] == 'Ieni')&lt;BR /&gt;if (vendor_id[2] == 'letn')&lt;BR /&gt;return (reg_edx &amp;amp; HT_BIT); // Genuine Intel Processor with&lt;BR /&gt;// Hyper-Threading Technology&lt;BR /&gt;return 0; // This is not a genuine Intel processor.&lt;BR /&gt;}&lt;BR /&gt;===================================================&lt;BR /&gt;&lt;BR /&gt;but some how when i compile the source code using gcc, here are the following errors return:&lt;BR /&gt;&lt;BR /&gt;***********************************************&lt;BR /&gt;[root@intel-1 HT_test]# gcc Ht.c&lt;BR /&gt;Ht.c: In function `HTSupported':&lt;BR /&gt;Ht.c:20: `__try' undeclared (first use in this function)&lt;BR /&gt;Ht.c:20: (Each undeclared identifier is reported only once&lt;BR /&gt;Ht.c:20: for each function it appears in.)&lt;BR /&gt;Ht.c:20: parse error before '{' token&lt;BR /&gt;Ht.c:41:27: warning: multi-character character constant&lt;BR /&gt;Ht.c:42:29: warning: multi-character character constant&lt;BR /&gt;Ht.c:43:31: warning: multi-character character constant&lt;BR /&gt;***********************************************&lt;BR /&gt;&lt;BR /&gt;Why is such happening? I tried to include but somehow this library isn't available.&lt;BR /&gt;&lt;BR /&gt;Is gcc no more supporting on Win32 API? if so, how can I change the above sample code to accomodate on RedHat 9.0 platform?&lt;BR /&gt;&lt;BR /&gt;Please guide!&lt;BR /&gt;&lt;BR /&gt;-yau-</description>
      <pubDate>Tue, 22 Mar 2005 13:47:05 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993715#M6308</guid>
      <dc:creator>yaumeileng</dc:creator>
      <dc:date>2005-03-22T13:47:05Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Pentium 4 Processor is supporting HT</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993716#M6309</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Yau -&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;There seems to be several things that are missing from the code example that you posted. Could you attach the source file or give a pointer to the source of the code? Have you been able to compile the code on a Windows system or a different version of Linux?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;My first guess is that this was meant to be compiled with the Intel compiler. I've never used inline assembly code, so I'm not sure if gcc supports that feature (I expect it does, so there might be some other problem).&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;--clay&lt;/DIV&gt;</description>
      <pubDate>Wed, 23 Mar 2005 02:47:18 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993716#M6309</guid>
      <dc:creator>ClayB</dc:creator>
      <dc:date>2005-03-23T02:47:18Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Pentium 4 Processor is supporting HT</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993717#M6310</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hello Yau,&lt;/DIV&gt;
&lt;DIV&gt;I can compile the example codeon Win32 using the Intel C++ compiler. I have to include excpt.h to avoid undefined references. The compile command is simply: &lt;FONT face="Courier New"&gt;icl ht_id.cpp -c&lt;/FONT&gt;.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Icannot compile the example code on Linux, however.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Best regards,&lt;/DIV&gt;
&lt;DIV&gt;Henry&lt;/DIV&gt;&lt;P&gt;Message Edited by hagabb on &lt;SPAN class="date_text"&gt;03-22-2005&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;01:21 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 23 Mar 2005 05:16:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993717#M6310</guid>
      <dc:creator>Henry_G_Intel</dc:creator>
      <dc:date>2005-03-23T05:16:07Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Pentium 4 Processor is supporting HT</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993718#M6311</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;I have attached the sample source code. Well I did include the header excpt.h but somehow is not working on Linux platform. &lt;BR /&gt;&lt;BR /&gt;Is there a way that i do not need the Intel Compiler C++ to compile on Linux? &lt;BR /&gt;&lt;BR /&gt;I need to write a code on detecting the HT support in my project which is running on Linux.&lt;BR /&gt;&lt;BR /&gt;Please help!&lt;BR /&gt;&lt;BR /&gt;Thank you&lt;BR /&gt;&lt;BR /&gt;-yau-</description>
      <pubDate>Wed, 23 Mar 2005 09:28:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993718#M6311</guid>
      <dc:creator>yaumeileng</dc:creator>
      <dc:date>2005-03-23T09:28:20Z</dc:date>
    </item>
    <item>
      <title>Re: Identify Pentium 4 Processor is supporting HT</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993719#M6312</link>
      <description>On linux, you need something closer to C++.  The code you show is specific to Microsoft compilers, which don't exist on linux.   Cygwin has headers which implement Microsoft  __try and __except, so you could attempt it by copying in those headers.  You would still have to deal with the __asm syntax, which differs from the default syntax for IA 32-bit linux.  Why don't you use something saner like strncmp() for your string comparison?&lt;BR /&gt;&lt;BR /&gt;g++ and Intel icc for linux are close enough in the extensions they handle that it should not make much difference which one you use.</description>
      <pubDate>Wed, 23 Mar 2005 14:05:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Identify-Pentium-4-Processor-is-supporting-HT/m-p/993719#M6312</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2005-03-23T14:05:35Z</dc:date>
    </item>
  </channel>
</rss>

