fsycl-link-targets

Tells the compiler to link only device code.

Syntax

Linux:

-fsycl-link-targets=T1,...,Tn

Windows:

-fsycl-link-targets=T1,...,Tn

Arguments

T

Is a target triple for the device code. You can specify more than one T.

Default

OFF

No link is performed.

Description

This option tells the compiler to link only device code. It is used in a link step.

It tells the compiler to link device code for the given target triples, and output multiple linked device code images. It does not produce fat binary.

To use this option, you must also specify option fsycl.

Note

We recommend that you should be familiar with ahead-of-time (AOT) compilation when using this option.

IDE Equivalent

None

Alternate Options

None

Example

The following command-line sequence demonstrates a way to use this option:

dpcpp -fsycl-targets=spir64-unknown-linux-sycldevice -c a.cpp -o a.o
dpcpp -fsycl-targets=spir64-unknown-linux-sycldevice -c b.cpp -o b.o
dpcpp -fsycl-link-targets=spir64-unknown-linux-sycldevice a.o b.o -o linked.spv
aoc linked.spv -o linked.aocx
dpcpp -fsycl-add-targets=fpga:linked.aocx a.o b.o -o final.out -lOpenCL -lsycl

See Also