Developer Guide and Reference

ID 767253
Date 10/31/2024
Public
Document Table of Contents

fopenmp-offload-mandatory, Qopenmp-offload-mandatory

Instructs the compiler to only generate a device version of OpenMP* target regions.

Syntax

Linux:

-fopenmp-offload-mandatory (for Clang compatibility)

Windows:

/Qopenmp-offload-mandatory

Arguments

None

Default

OFF

When this option is not specified, the compiler generates both a host (CPU) and a target device version of OpenMP target regions; if offloading fails for a target region, it executes on the host.

Description

This option tells the compiler to generate only a target device (GPU) version of OpenMP target regions. A runtime error is issued if offloading fails.

NOTE:

To use this option, you must enable OpenMP offloading by specifying option -fopenmp-targets (Linux) or /Qopenmp-targets (Windows).

IDE Equivalent

None

Alternate Options

None

Example

The following shows an example of using this option::

Linux

icpx -qopenmp -fopenmp-targets=spir64 -fopenmp-offload-mandatory test.cpp

Windows

icx /Qopenmp /Qopenmp-targets:spir64 /Qopenmp-offload-mandatory test.cpp