- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel C++ compiler requires one to include the header file: mathimf.h so as to use Intel provided math functions. What does the FORTRAN compiler do? Does it use Intel math functions by default? Or do I have to do something to enable that?
Thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel Fortran compiler uses the Intel math library if it provides the function, the C math library if it doesn't. You don't have control over this.
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I suppose there are several levels to this.
The documentation of mathimf is confusing, at least to me, but I don't think your characterization of it determining whether Intel C++ or C99 use Intel functions is accurate to a great extent. You could examine your own calling .o by using nm to get more information.
ifort never calls any x87 long double functions, as gfortran real(10) would do, so that functionality of mathimf.h isn't relevant, and you can't call glibc long double functions from ifort.
There is a fairly complete set of Intel math functions, requiring at least SSE2, shared by ifort and icc, and you have no real choice about those being called by ifort in preference to those from glibc, which might be called if Intel math functions are missing, or with ifort -mia32.
Auto-vectorized math function calls are always to the Intel libsvml. To some extent, you can over-ride default auto-vectorization choices by the fast-transcendentals option, as well as by -fp-math and no-vec settings.
There are both Intel math functions which make a choice of code path according to CPU architecture at run time, and those which don't switch at run time, invoked by -fimf-arch-consistency,
Most of these work the same with Intel Fortran and C++.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
The Intel Fortran compiler uses the Intel math library if it provides the function, the C math library if it doesn't. You don't have control over this.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Dear Intel Developers Community,
An issue relative to control on math lib to be used. Situation:
1. When a compiled fortran code is executed, the computation time is T
2. When this same fortran code is transformed as a dynamic lib of a C++ application, the execution is 5*T.
It was identified that cos() calls in the fortran code were responsible for that performance downgrade:
in situation 1, it is cos() of lib libimf.so that is called.
In situation 2, is is cos() of lib libm.so.6 that is called
How to keep control on Library to be used in situation 2?
BR
Gael.
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page