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

Use of /QaxP directive in some modules

tbruegge
Beginner
436 Views

I have afunctionthat benefits greatly from using a /QaxP directive. However, I would like to use this directive only for thisfunction (which is in a separate source file)and not have to requalify my entire application with the changed compiler switches. I was wondering if the run-time checking for processor architecture that is implied by the QaxP directive requires that I use this setting for all source files in my application, or whether I can use it only for selected source files. I should also mention that the application mixes Fortran and C/C++, if that matters.

Thanks for any responses that can shed light on this question.

0 Kudos
3 Replies
JenniferJ
Moderator
436 Views

Yes. You can use "-QaxP" for specific files only. You don't have to use it for the whole program.

But you cann't just use "-QaxP" for the function only. A work around is to move the function to a file, and compile this file with "-QaxP'.

If you're thinking about the pragma "#optimize ("", off")", it turns off all the optmizations passed by the command line. So all the functions after will be compiled with no optimizations. So it may hurt the performance.

0 Kudos
TimP
Honored Contributor III
436 Views

With the 32-bit compilers, you would have to link with a vectorizing option, such as /QaxP, to be sure of getting all the required libraries. This would not affect the files previously compiled without such options.

0 Kudos
Steven_L_Intel1
Employee
436 Views

If you are building an executable with some files built with /QaxP and some not, you shouldn't need to do anything special to link as long as you haven't also compiled with /Zl to suppress default library references.If you do get linking errors, just add svml_disp.lib to the list of libraries.

0 Kudos
Reply