PTX ISA v9.4

12.4. Pragma Strings: "frequency"

"frequency"

Specify frequency for basic block execution.

Syntax

ptx
.pragma "frequency n";

Description

The "frequency" pragma is a directive that specifies the number of times a basic block is executed by an executing thread. The optimizing compiler backend treats this pragma as a hint which will be used for optimizations.

Operand n is a 64-bit non-negative integer constant that specifies the execution frequency.

Note that in order to have the desired effect of this pragma, it should be specified at the start of the basic block. Basic block is defined as a straight-line sequence of instructions with only one entry point and one exit point.

PTX ISA Notes

Introduced in PTX ISA version 9.0.

Target ISA Notes

Supported on all target architectures.

Examples

ptx
.entry foo (...)
{
    .pragma "frequency 32";
    ...
}
esc
Type to search across all documentation