-qoffload

Pragma equivalent

None.

Purpose

Enables support for offloading OpenMP target regions to an NVIDIA GPU.

You can use the #pragma omp target OpenMP directive to define a target region.

For -qoffload to take effect, you must specify the -qsmp option to enable the support for OpenMP target regions.

Syntax

Read syntax diagramSkip visual syntax diagram
        .-nooffload-.   
>>- -q--+-offload---+------------------------------------------><

Defaults

-qnooffload

Usage

To use the -qoffload option, you must install the CUDA Toolkit. To install the CUDA Toolkit, use the Package Manager installation. The Runfile installation is currently not supported on Power® processors. For instructions about Package Manager installation, see the NVIDIA CUDA Installation Guide for Linux.

You must specify the -qoffload option on both the compile and link steps. If you do not specify -qoffload, target regions run on the host, and the compiler does not generate any device code.

The compiler optimizes device code by default. You can use the -qoffload option with -O2, -O3, -Ofast, and -O3 -qhot. You cannot use the -qoffload option with -O4, -O5, -qipa, -qpdf1, or -qpdf2.

Predefined macros

None.

Examples

To compile myopenmpprogram.c, enter the following command:
xlC -qsmp -qoffload myopenmpprogram.c -o myopenmpprogram
To compile myopenmpprogram.c into an object file and link it afterwards, enter the following commands:
xlC -c -qsmp -qoffload myopenmpprogram.c -o myopenmpprogram.o
xlC -qsmp -qoffload myopenmpprogram.o -o myopenmpprogram

Related information



Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us