Developer Guide and Reference

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

SUBDEVICE

Parallel Directive Clause: Specifies which tiles or compute slices (c-slices) of the offload device the offloaded code will run on.

Syntax

SUBDEVICE ( [level,] start [:length [:stride]] )

level

Is a non-negative integer constant. If level is not specified, the value 0 is used.

start

Is a non-negative integer expression.

length

Is a positive integer expression. If length is not specified, the value 1 is used.

stride

Is a positive integer expression. If stride is not specified, the value 1 is used.

The SUBDEVICE clause specifies which sub-devices the offloaded code is to execute on. A GPU device may be made up of multiple tiles, and each tile may be made up of multiple compute slices (also called c-slices).

Specifying level 0 selects tiles, specifying level 1 selects c-slices. The tiles and c-slices are numbered 0 to n. start, length, and stride act like an array section subscript to select the indices of the tiles or c-slices the offloaded code will execute on.

At most one SUBDEVICE clause can appear in a directive that allows the clause.

Example

subdevice (0, 2:5) runs on tiles 2, 3, 4, and 5.

subdevice (1, 2:6:2) runs on compute slices 2, 4 and 6.