Intel® C++ Compiler
Community support and assistance for creating C++ code that runs on platforms based on Intel® processors.

mathimf and windows

Petros_Mamales
Beginner
3,684 Views

Hi,

I have a couple of questions on the usage of the math library in windows (64bit, vs2010).

In the documentation of the intel c++ compiler (12.1), in the article "Using Intel Math Library" a simple program appropriate for windows is presented and then the user is instructed to add the compilation flags /Qlong-double /Qpc80 . After adding them in the Additional Compile Options of project properties (there is no visual entry for this), I got a warning that the options are not recognized and therefore ignored . What am I doing wrong ?

Also, tried to go through the mathimf.h file and so some ppc macro __INTEL_COMPILER (or something very similar). Where is this defined ? Should I define it ? Also there seems to be __ICL etc. where can one obtain a list of the meaning of these macros ? Unfortunately the documentation shipped with the product (Parallel Studio 2011) leaves some to be desired..

Thank you in advance for your help,

Petros

0 Kudos
97 Replies
Petros_Mamales
Beginner
704 Views

HI Melanie,

Thank you for the suggestion.  No, it did not pass :

1>MessageBuildingWithCompiler:
1>  Building with Intel(R) C++ Compiler 12.1
1>ClCompile:
1>  ***** ClCompile (Win32 - Intel C++)
1>icl : warning #10148: option '/Qlong_double' not supported
1>icl : warning #10148: option '/Qpc80' not supported
1>  main.cpp

0 Kudos
Petros_Mamales
Beginner
704 Views

Addition : Melanie's testimony could serve as proof beyond doubt that, the availability of 80 bit long doubles on windows has nothing to do with the ms rt.

0 Kudos
Bernard
Valued Contributor I
704 Views

>>>Here is an example: Say I want to calculate the curtosis of a statistical sample , of a vector of size say 1,000,000 elements -curtosis because it involves powers of the element up to fourth. Then I choose to tun this accross threads for efficiency. The (partial)sums of the elements can be declared as long doubles and in the end of the day, when diided by the -long double'd- size of 1,000,000 be casted down to the familiar old friend the ms double, saving the user the headache of worrying about over/underflow and compromise of precision.>>>

This is obvious that we have a different projects and different needs.As I told you earlier for my project  I would choose a 2D double precision or 4D  single precision vector of scalar values instead of increased precision of the single scalar result.

0 Kudos
Bernard
Valued Contributor I
704 Views

>>>I think the documentation is simply wrong - there is no other windows run time for intel to offer the etension to- and misleading.>.>>

Sorry I can not understand what do you mean by writing this sentence.

0 Kudos
Bernard
Valued Contributor I
704 Views

>>>Addition : Melanie's testimony could serve as proof beyond doubt that, the availability of 80 bit long doubles on windows has nothing to do with the ms rt.>>>

Intel compiler supports long double type,but when Intel compiler calls Micrososft implementation of printf() which in turn does not support long double.

0 Kudos
Petros_Mamales
Beginner
704 Views

Iliyapolak,

Understood that different people have different projects/needs. So, the question is very simple:

does the compiler support an 80bit long double as the documentation states?

The answer to this, as is becoming increasingly clear, is negative.

Noone cares about the silly printf, noone ever intended to call it - except from the very unfortunate test in

the documentation- I mean, who really wants to show a new feature by focussing on what it cannot do ;-))

Please, let's not keep revisiting what we have already covered.

Thank you for your help,

P-

0 Kudos
Petros_Mamales
Beginner
704 Views

At this point, I think I should put the whole thing to rest. We have been trying to get to a legit answer since last Saturday, almost a week.

If there is some kind of a workaround I would like to know, but do not wish to "debate" no matter how well- intended - and I trully belive the are -

people are.

The good news is that in a next release - as Melanie said- the issue is solved and I will have to wait until the next release and I meet in the same environment ;-))

Thank you very much everyone for your kind efforts to help,

P-

0 Kudos
Petros_Mamales
Beginner
704 Views

At this point, I think I should put the whole thing to rest. We have been trying to get to a legit answer since last Saturday, almost a week.

If there is some kind of a workaround I would like to know, but do not wish to "debate" no matter how well- intended - and I trully belive the are -

people are.

The good news is that in a next release - as Melanie said- the issue is solved and I will have to wait until the next release and I meet in the same environment ;-))

Thank you very much everyone for your kind efforts to help,

P-

0 Kudos
SergeyKostrov
Valued Contributor II
704 Views
Hi Petros, >>...If there is some kind of a workaround I would like to know... I'll provide another simple test-case for you and if it doesn't work then we will need to simply wait for another version of Intel C++ compiler ( absolutely right point of view... ). Hi Melanie, Thank you for the test-case. Unfortunately, I don't think that Petros wanted to verify all these constants. Instead, Petros wanted to improve accuracy of calculations of some algorithm on a data set with ~1,000,000 elements declared as 'long double'. By the way, I didn't understand what version of Intel C++ compiler you're using. You informed everybody '... I have a newer version of the compiler ...'. Best regards, Sergey
0 Kudos
Petros_Mamales
Beginner
704 Views

Sergey,

Melanie, mainly provided with a suggestion of an alternative flag.( no misunderstandings: I did try her test.c )

Also, not all the 1,000,000 elements are long double. Only their (partial) sums !!

Best Regards,

P-

0 Kudos
Bernard
Valued Contributor I
704 Views

>>>Noone cares about the silly printf, noone ever intended to call it - except from the very unfortunate test in

the documentation- I mean, who really wants to show a new feature by focussing on what it cannot do ;-))>>>

I know that nobody including me cares about printf,but in the end while working on Win platform you are dependent on Windows chain of execution components.Function printf was brought as a example because it was part of your code. Hope it helps.

0 Kudos
SergeyKostrov
Valued Contributor II
704 Views
Petros, as I promised a different test-case will be provided. I finally found article 'Using Intel Math Library' you've mentioned. Also, >>...not all the 1,000,000 elements are long double. Only their (partial) sums !!.. this is a very important note and I'll try to simulate if a processing with mixed floating-point data types, for example float and double, improves accuracy of results.
0 Kudos
Bernard
Valued Contributor I
704 Views

Sergey Kostrov wrote:

Petros, as I promised a different test-case will be provided. I finally found article 'Using Intel Math Library' you've mentioned. Also,

>>...not all the 1,000,000 elements are long double. Only their (partial) sums !!..

this is a very important note and I'll try to simulate if a processing with mixed floating-point data types, for example float and double, improves accuracy of results.

Such a test case could be very interesting.Mainly for precission and accuracy of the accumulated sum.Sadly all this process at runtime is performed by the CPU microcode and hardware and it is opaque to the programmer.

0 Kudos
Melanie_B_Intel
Employee
704 Views

The most interesting thing about the test case is that it prints pass when using the Intel compiler with /Qlong-double and fail otherwise.

You don't need to wait for the next release, the current download of the Intel c++ compiler for windows supports /Qlong-double

I found a version of the 12.1 compiler to test on Windows with vs2010. I tested both ia32 and intel64, and the test passes in either case. Since you have 12.1 also, it's still a puzzle as to why the option isn't recognized. Your compiler doesn't appear to print the same versionn string, I'll check if this is a version specific thing...   I usually use the compiler from the command line (cmd.exe). You can use iclvars.bat which is in the compiler installation directory to set up your path. 

>icl /Qlong-double test.cIntel(R) C++ Compiler XE for applications running on IA-32, Version 12.1.5.344 Build 20120612Copyright (C) 1985-2012 Intel Corporation.  All rights reserved.
test.cMicrosoft (R) Incremental Linker Version 10.00.40219.01Copyright (C) Microsoft Corporation.  All rights reserved.
-out:test.exetest.obj 

>.\test.exe
TEST PASSED

0 Kudos
SergeyKostrov
Valued Contributor II
704 Views
>>...Version 12.1.5.344 Build 20120612... Finally it is clear what version you're using. Thank you, Melanie.
0 Kudos
SergeyKostrov
Valued Contributor II
704 Views
Petros, I've completed a first part of my investigation related to /Qlong-double /Qpc80 options of Intel C++ compiler ( version 12.1.3.300 / even older than you have ) and all results will be posted soon. Note: All outputs are provided AS IS and without any modifications. Here is a very simple test-case: ... // Sub-Test 66 - Problem with 'long double' floating-point data type { printf( "Sub-Test 66\n" ); printf( "Size of [ long double ] is: %d\n", sizeof( long double ) ); } ... All the rest tests, that is precision control and accuracy evaluation, will be done next week and please monitor the thread. Best regards, Sergey
0 Kudos
SergeyKostrov
Valued Contributor II
704 Views
[ Compilation output without /Qlong-double /Qpc80 ] ------ Build started: Project: IccTestApp, Configuration: Debug Win32 ------ Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment) Stdphf.cpp *** ScaLib Message: Compiling with Intel C++ v12.1.3 *** *** ScaLib Message: Configuration - Desktop - _WIN32_ICC - DEBUG *** *** ScaLib Message: Compiling for Intel Processing Unit ( 32-bit ) *** *** ScaLib Message: Declared HRT-Types *** *** ScaLib Message: Unicode Character Set *** *** ScaLib Message: Support for HRT-Functions Enabled *** Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment) IccTestApp.cpp Linking... (Intel C++ Environment) xilink: executing 'link' Creating library C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.lib and object C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.exp Embedding manifest... (Microsoft VC++ Environment) IccTestApp - 0 error(s), 0 warning(s), 0 remark(s) ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ========== [ Test output ] C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug>IccTestAppD.exe Application - IccTestApp - WIN32_ICC - Debug Tests: Start > Test1017 Start < Sub-Test 66 Size of [ long double ] is: 8 Test Completed in 0 ticks > Test1017 End < Tests: Completed Memory Blocks Allocated : 0 Memory Blocks Released : 0 Memory Blocks NOT Released: 0 Memory Tracer Integrity Verified - Memory Leaks NOT Detected Deallocating Memory Tracer Data Table Completed [ Complete list of Intel C++ compiler options ] /c /Od /I "..\..\Include" /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_WIN32_ICC" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /Yu"Stdphf.h" /Fp"Debug\IccTestAppD.pch" /Fo"Debug/" /W5 /nologo /Wp64 /ZI /TP /U "_WIN32_MSC" /U "_WIN32CE_MSC" /U "WIN32_PLATFORM_PSPC" /U "WIN32_PLATFORM_WFSP" /U "WIN32_PLATFORM_WM50" /U "_WIN32_MGW" /U "_WIN32_BCC" /U "_COS16_TCC" /Qopenmp /Qdiag-disable:111,673
0 Kudos
SergeyKostrov
Valued Contributor II
704 Views
[ Compilation output with /Qlong-double ] ------ Build started: Project: IccTestApp, Configuration: Debug Win32 ------ Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment) Stdphf.cpp *** ScaLib Message: Compiling with Intel C++ v12.1.3 *** *** ScaLib Message: Configuration - Desktop - _WIN32_ICC - DEBUG *** *** ScaLib Message: Compiling for Intel Processing Unit ( 32-bit ) *** *** ScaLib Message: Declared HRT-Types *** *** ScaLib Message: Unicode Character Set *** *** ScaLib Message: Support for HRT-Functions Enabled *** Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment) IccTestApp.cpp Linking... (Intel C++ Environment) xilink: executing 'link' Creating library C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.lib and object C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.exp Embedding manifest... (Microsoft VC++ Environment) IccTestApp - 0 error(s), 0 warning(s), 0 remark(s) ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ========== [ Test output ] C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug>IccTestAppD.exe Application - IccTestApp - WIN32_ICC - Debug Tests: Start > Test1017 Start < Sub-Test 66 Size of [ long double ] is: 16 Test Completed in 0 ticks > Test1017 End < Tests: Completed Memory Blocks Allocated : 0 Memory Blocks Released : 0 Memory Blocks NOT Released: 0 Memory Tracer Integrity Verified - Memory Leaks NOT Detected Deallocating Memory Tracer Data Table Completed [ Complete list of Intel C++ compiler options ] /c /Od /I "..\..\Include" /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_WIN32_ICC" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /Yu"Stdphf.h" /Fp"Debug\IccTestAppD.pch" /Fo"Debug/" /W5 /nologo /Wp64 /ZI /TP /U "_WIN32_MSC" /U "_WIN32CE_MSC" /U "WIN32_PLATFORM_PSPC" /U "WIN32_PLATFORM_WFSP" /U "WIN32_PLATFORM_WM50" /U "_WIN32_MGW" /U "_WIN32_BCC" /U "_COS16_TCC" /Qopenmp /Qdiag-disable:111,673 /Qlong-double
0 Kudos
SergeyKostrov
Valued Contributor II
711 Views
[ Compilation output with /Qlong-double /Qpc80 ] ------ Build started: Project: IccTestApp, Configuration: Debug Win32 ------ Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment) Stdphf.cpp Warning #1680: this option conflicts with the floating-point mode specification: -Qpc80 *** ScaLib Message: Compiling with Intel C++ v12.1.3 *** *** ScaLib Message: Configuration - Desktop - _WIN32_ICC - DEBUG *** *** ScaLib Message: Compiling for Intel Processing Unit ( 32-bit ) *** *** ScaLib Message: Declared HRT-Types *** *** ScaLib Message: Unicode Character Set *** *** ScaLib Message: Support for HRT-Functions Enabled *** Compiling with Intel(R) C++ Compiler XE 12.1.3.300 [IA-32]... (Intel C++ Environment) IccTestApp.cpp Warning #1680: this option conflicts with the floating-point mode specification: -Qpc80 Linking... (Intel C++ Environment) xilink: executing 'link' Creating library C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.lib and object C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug\IccTestAppD.exp Embedding manifest... (Microsoft VC++ Environment) IccTestApp - 0 error(s), 0 warning(s), 2 remark(s) ========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ========== [ Test output ] C:\WorkEnv\AppsWorkDev\AppsTst\IccTestApp\Debug>IccTestAppD.exe Application - IccTestApp - WIN32_ICC - Debug Tests: Start > Test1017 Start < Sub-Test 66 Size of [ long double ] is: 16 Test Completed in 0 ticks > Test1017 End < Tests: Completed Memory Blocks Allocated : 0 Memory Blocks Released : 0 Memory Blocks NOT Released: 0 Memory Tracer Integrity Verified - Memory Leaks NOT Detected Deallocating Memory Tracer Data Table Completed [ Complete list of Intel C++ compiler options ] /c /Od /I "..\..\Include" /D "WIN32" /D "_CONSOLE" /D "_DEBUG" /D "_WIN32_ICC" /D "_VC80_UPGRADE=0x0710" /D "_UNICODE" /D "UNICODE" /GF /EHsc /RTC1 /MTd /GS /fp:precise /Yu"Stdphf.h" /Fp"Debug\IccTestAppD.pch" /Fo"Debug/" /W5 /nologo /Wp64 /ZI /TP /U "_WIN32_MSC" /U "_WIN32CE_MSC" /U "WIN32_PLATFORM_PSPC" /U "WIN32_PLATFORM_WFSP" /U "WIN32_PLATFORM_WM50" /U "_WIN32_MGW" /U "_WIN32_BCC" /U "_COS16_TCC" /Qopenmp /Qdiag-disable:111,673 /Qlong-double /Qpc80
0 Kudos
SergeyKostrov
Valued Contributor II
711 Views
Here are details on My Development Environment: OS: Windows XP 32-bit SP3 IDE: Visual Studio 2005 Professional Edition SP1 ( and all the rest updates ) Intel C++ compiler version ( Composer XE 2011 Update 9 / 12.1.3.300 [IA-32] ) tuned for investigation of your problem.
0 Kudos
Bernard
Valued Contributor I
711 Views

>>>Size of [ long double ] is: 16>>>

So the size for long double is 16 bytes.Exactly as you pointed out in one of your posts.It is interesting what is memory layout of such a value.I suppose that the value(binary number)is padded with 6 bytes of 0's for alignment.

0 Kudos
Reply