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

ID 767253
Date 3/22/2024
Public
Document Table of Contents

ftarget-register-alloc-mode, Qtarget-register-alloc-mode

Specifies a register allocation mode for specific hardware for use by supported target backends.

Syntax

Linux:

-ftarget-register-alloc-mode=device-name:reg-mode[, device-name:reg-mode][,...]

Windows:

/Qtarget-register-alloc-mode:device-name:reg-mode[, device-name:reg-mode][,...]

Arguments

device-name

Is the device name. Currently, you can only specify the following:

pvc

Indicates a Ponte Vecchio (PVC) device.

More devices may be added in the future.

reg-mode

Is the register allocation mode. It can be any of the following:

default

Tells the target backend to not impose any specification when choosing a register allocation mode.

small

Tells the target backend to select small register allocation mode (for PVC, this means to use the 128 register file).

large

Tells the target backend to select large register allocation mode (for PVC, this means to use the 256 register file).

auto

Tells the target backend to use internal heuristics to select a register allocation mode based on kernel analysis.

Default

The following is the default behavior on PVC hardware:

Linux: -ftarget-register-alloc-mode=pvc:auto

Tells the target backend to use internal heuristics to select a register allocation mode based on kernel analysis.

Windows: /Qtarget-register-alloc-mode=pvc:default

Tells the target backend to not impose any specification when choosing a register allocation mode.

Description

This option specifies a register allocation mode for specific hardware for use by supported target backends. Currently, it has no effect if you are targeting hardware other than Ponte Vecchio (PVC).

CAUTION:

When compiling a SYCL program or an OMP-offload program for PVC or if the program will run on PVC, you should not specify the register allocation mode using IGC (Intel Graphics Compiler) options such as -ze-opt-large-register-file in the -Xs high-level option. You should instead use option -ftarget-register-alloc-mode (Linux) or /Qtarget-register-alloc-mode (Windows).

However, when you are targeting other hardware, you should use the IGC option.

For information about available SYCL drivers, refer to Invoke the Compiler.

NOTE:

When SYCL offloading is enabled, this option only applies to device-specific compilation.

IDE Equivalent

None

Alternate Options

None

Examples

The following shows examples of using this option:

Linux

icpx -fiopenmp -fopenmp-targets=spir64 -ftarget-register-alloc-mode=pvc:large a.cpp
icpx -fsycl -ftarget-register-alloc-mode=pvc:large -fsycl-targets=spir64_gen -Xs "-device pvc"

Windows

icx /Qiopenmp /Qopenmp-targets:spir64 /Qtarget-register-alloc-mode:pvc:large a.cpp
icx -fsycl /Qtarget-register-alloc-mode:pvc:large -fsycl-targets=spir64_gen -Xs "-device pvc"