Intel® oneAPI DPC++/C++ Compiler Developer Guide and Reference

ID 767253
Date 3/22/2024
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

fprofile-sample-generate

Enables the compiler and linker to generate information and adjust optimization for Hardware Profile-Guided Optimization (HWPGO).

Syntax

Linux:

-fprofile-sample-generate[=level]

Windows:

/fprofile-sample-generate[:level]

Arguments

level

Specifies which actions the compiler should perform. Possible values are:

none

This is the same as not specifying option fprofile-sample-generate.

keep-all-opt

Tells the compiler and linker to generate information for HWPGO without disabling any optimization. This is the default if you do not specify level.

med-fidelity

Tells the compiler and linker to generate information for HWPGO and disables some optimizations that inhibit profile fidelity.

max-fidelity

Tells the compiler and linker to generate information for HWPGO and disables most compiler optimizations. This provides a binary that targets execution count profile fidelity above all else.

Default

OFF

The compiler and linker do not generate information for HWPGO.

Description

This option enables the compiler and linker to generate information and adjust optimization for Hardware Profile-Guided Optimization (HWPGO).

On Windows, the following cautions apply when using this option:

  • The LLD linker is required and you must specify /profile-sample-generate as a link option if the LLD linker is not invoked by icx/icpx.

  • Do not specify option /Ob0 or /Ob1 with option /fprofile-sample-generate or /fprofile-sample-use because it will disable inlining.

NOTE:

This option only applies to host compilation. When offloading is enabled, it does not impact device-specific compilation.

IDE Equivalent

None

Alternate Options

None