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

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

qopenmp, Qopenmp

Enables recognition of OpenMP* features, such as parallel, simd, and offloading directives, and tells the parallelizer to generate multi-threaded code based on OpenMP* directives. This is an alternate name for compiler option -fiopenmp (and /Qiopenmp).

Syntax

Linux:

-qopenmp

-qno-openmp

Windows:

/Qopenmp

/Qopenmp-

Arguments

None

Default

-qno-openmp or /Qopenmp-

No OpenMP* multi-threaded code is generated by the compiler.

Description

This option enables recognition of OpenMP* features and tells the parallelizer to generate multi-threaded code based on OpenMP* directives. The code can be executed in parallel on both uniprocessor and multiprocessor systems.

This option works with any optimization level. Specifying no optimization (-O0 on Linux* or /Od on Windows*) helps to debug OpenMP applications.

Options -fiopenmp (and /Qiopenmp) are alternate names for options -qopenmp (and /Qopenmp).

NOTE:

To enable offloading to a specified GPU target, you must also specify option -fopenmp-targets (Linux*) or /Qopenmp-targets (Windows).

NOTE:

Options that use OpenMP* API are available for both Intel® microprocessors and non-Intel microprocessors, but these options may perform additional optimizations on Intel® microprocessors than they perform on non-Intel microprocessors.

The list of major, user-visible OpenMP constructs and features that may perform differently on Intel® microprocessors versus non-Intel microprocessors include: locks (internal and user visible), the SINGLE construct, barriers (explicit and implicit), parallel loop scheduling, reductions, memory allocation, thread affinity, and binding.

Product and Performance Information

Performance varies by use, configuration and other factors. Learn more at www.Intel.com/PerformanceIndex.

Notice revision #20201201

IDE Equivalent

Visual Studio: Language > OpenMP* Support

Eclipse: Language > Process OpenMP Directives

Alternate Options

Linux: -fiopenmp

Windows: /Qiopenmp

Examples

The following enables OpenMP parallelization (but no offloading) of OpenMP constructs such as "parallel", "loop" and "simd":

icx -qopenmp foo.c   

Because option -qopenmp is not specified, the following enables SIMD vectorization, but no OpenMP parallelization or offloading:

icpx -qopenmp-simd foo.c 

The following enables OpenMP parallelization and SIMD vectorization + offloading to a spir64 target:

icpx -qopenmp -fopenmp-targets=spir64 bar1.cpp  

See Also