?
Solved

Disable FMA in Compiler

Posted on 2008-11-07
21
Medium Priority
?
761 Views
Last Modified: 2013-12-17
How to disable and enable the FMA option of g++ compiler?
0
Comment
Question by:thirst4truth
  • 11
  • 9
20 Comments
 
LVL 53

Expert Comment

by:Infinity08
ID: 22911626
FMA ?
0
 

Author Comment

by:thirst4truth
ID: 22911751
Yes, Fused-Multiply Add
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22911788
use -mfused-madd to enable, and -mno-fused-madd to disable. Enabled is the default.
0
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 

Author Comment

by:thirst4truth
ID: 22917375
i tried to disable FMA with following command line, but It is followed by a error.

csci2>g++ -c -mno-fused-madd main.cpp heap.cpp
cc1plus: error: invalid option `no-fused-madd'
cc1plus: error: invalid option `no-fused-madd'

can you help with it ?

regards,
Sata
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22917420
You are on an architecture that supports Fused-Multiply Add, aren't you (Mips for example) ?

What version of g++ do you have ?
0
 

Author Comment

by:thirst4truth
ID: 22917474
I believe it is a standalone sparc machine.

The following is the

csci2>g++ --version
g++ (GCC) 3.4.3 (csl-sol210-3_4-branch+sol_rpath)
Copyright (C) 2004 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

csci2>uname -X
System = SunOS
Node = csci2
Release = 5.10
KernelID = Generic_118855-33
Machine = i86pc
BusType = <unknown>
Serial = <unknown>
Users = <unknown>
OEM# = 0
Origin# = 1
NumCPU = 4




0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22917514
Are you sure that your system supports fused multiply add ? I'm not sure whether Sparc does - I think Sparc64 does, but you'll have to check that.

In any case, gcc does not provide the -mno-fused-madd and -mfused-madd options for Sparc :

        http://gcc.gnu.org/onlinedocs/gcc-3.4.6/gcc/SPARC-Options.html#SPARC-Options
0
 

Author Comment

by:thirst4truth
ID: 22917555
Thank you for your hasten response.
1) How can I know that my system support FMA or not?

2) Does SUN provides its native C++ compiler through which I can disable and enable FMA?


 
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22917611
I'm a bit surprised that you want to disable fused multiply add without even knowing whether your system supports it. Why do you want to disable it ?

Sun's C compiler - if it's installed - is cc.
0
 

Author Comment

by:thirst4truth
ID: 22917735
I am checking to see the performance of my program by enabling and disabling FMA.

I am currently working on a school server. I have no clue of how it is configured.

Also cc I believe is a C compiler. I am looking the SUN CPP compiler.

Thank you.

0
 

Author Comment

by:thirst4truth
ID: 22917754
I have used gcc on Intel machine this time, instead of Sparc. It throw me the following error:


csci>g++ -mno-fused-madd main.cpp heap.cpp
cc1plus: error: invalid option `no-fused-madd'
cc1plus: error: invalid option `no-fused-madd'
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22917790
>> Also cc I believe is a C compiler.

Yes, that's what I said :)


>> I am looking the SUN CPP compiler.

That's CC


>> I have used gcc on Intel machine this time, instead of Sparc. It throw me the following error:

Try specifying the architecture using the -march flag.
0
 

Author Comment

by:thirst4truth
ID: 22917875
wow. cool.

CC works. However I am using FMA disbaling option.

csci2>CC -fma=none main.cpp heap.cpp
CC: Warning: Option -fma=none passed to ld, if ld is invoked, ignored otherwise
main.cpp:
heap.cpp:
ld: fatal: option -f and building a dynamic executable are incompatible
ld: fatal: Flags processing errors

Can u help me with this?

Thank you.

0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22917887
0
 

Author Comment

by:thirst4truth
ID: 22917984
Hi Expert

I learned that by default CC has FMA disabled (The default is -fma=none. ) and by default gcc has FMA enabled.

So If I compile a program with CC, it suppose to give me a.out file with FMA Disabled.
And again I will compile the same program with gcc, then it suppose to give me a.out file with FMA Enabled.

Am I correct?  Please correct me if I am wrong.

Thank you.
0
 
LVL 53

Expert Comment

by:Infinity08
ID: 22918001
What's the point ? Comparing them would be meaningless, since you're using different compilers.

Did you read the link I posted ?
0
 

Author Comment

by:thirst4truth
ID: 22918048
I read your that posting, I didn't understood following :

Minimum requirements are -xarch=sparcfmaf and an optimization level of at least -xO2

How can I check these minimum requirements.

the -fma=fused currently giving be fatal error.

At this point, I need to show atleast why the fma option is not working?
0
 
LVL 53

Accepted Solution

by:
Infinity08 earned 2000 total points
ID: 22918062
They are the options that are required to be there for the fma=fused to work. Note that you'll need a Sparc64 for that as I said earlier.
0
 

Author Closing Comment

by:thirst4truth
ID: 31514510
Thank you for your help.
Appreciated.
0
 

Author Comment

by:thirst4truth
ID: 22918079
Thank you.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

The main intent of this article is to make you aware of ‘Exchange fail to mount’ error, its effects, causes, and solution.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
The viewer will learn how to successfully download and install the SARDU utility on Windows 8, without downloading adware.
Whether it be Exchange Server Crash Issues, Dirty Shutdown Errors or Failed to mount error, Stellar Phoenix Mailbox Exchange Recovery has always got your back. With the help of its easy to understand user interface and 3 simple steps recovery proced…

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question