Intel® C++ Compiler 16.0 User and Reference Guide

Controlling Backup Execution on the CPU

This topic only applies to Intel® 64 and IA-32 architectures targeting Intel® Graphics Technology.

Heterogeneous applications use the target to execute offloaded code if the target and the Intel® Graphics Technology driver supporting offload are available and correctly initialized. If these conditions are not met, the application can use the host to execute CPU code compiled from the same source code.

The GFX_CPU_BACKUP environment variable controls whether heterogeneous code is executed on the host when the target is not available.

If the if clause of the offload pragma evaluates to false then the code is executed on the host regardless of the target's availability.

If the if clause of the offload pragma is not provided or evaluates to true and the target and the Intel® Graphics Technology driver supporting offload are available and correctly initialized, then the code is executed on the target. Otherwise, back-up execution on the host depends on the value of GFX_CPU_BACKUP.

To prevent execution from occurring on the host, which causes the application to fail when the target is not available, set GFX_CPU_BACKUP to 0.

To execute on the host when the target is not available, set GFX_CPU_BACKUP to 1. By default, this variable is set to 1, so the code is executed on the host.