Intel® C++ Compiler 16.0 User and Reference Guide

Offload Extract Tool

This topic only applies to Intel® Many Integrated Core Architecture (Intel® MIC Architecture) and to Intel® 64 and IA-32 architectures targeting Intel® Graphics Technology.

Description

The Offload Extract tool is a standalone tool that extracts embedded target objects from fat objects and embedded target binaries from fat executables on Windows* and Linux* systems. The tool can be used for Intel® MIC Architecture and Intel® Graphics Technology related offload extraction. For simplicity, in this topic, the Intel® MIC Architecture target objects and executables will be referred to as MIC target objects and executables and the Intel® Graphics Technology based target objects and executables will be referred to as GFX target objects and executables.

Features and Benefits

By default, you cannot use analyzing and debugging tools like objdump and readelf to directly examine offload MIC or GFX objects/binaries because they are embedded in the host object or binary.

Use the Offload Extract tool to extract GFX/MIC object/binary from a fat object/binary on 64-bit Linux* or 32-/64-bit Windows* systems. The extracted object/binary is an ELF object that can be analyzed with objdump or readelf analyzing tools.

Note

The text section of the GFX ELF object is vISA (virtual ISA for the GFX JIT compiler) and therefore not all features of the object analysis tools will work on the GFX objects. For example, the disassembler will not work on the GFX object.

Using the Tool

To extract the target object files, invoke the offload extract tool as follows:

offload_extract  <fat host object>

The GFX and/or MIC target objects are extracted into object files with the same name as the input object file but with the substring GFX or MIC appended to the filename. If both GFX and MIC target objects are embedded both will be extracted. Since the target objects are in ELF format the object file name extension will be .o. For example,

offload_extract host.obj => hostGFX.o and/or hostMIC.o

To extract the target executables, invoke the offload extract tool as follows:

offload_extract  <fat host binary>

The GFX and/or MIC target executables are extracted into target executable files with the same name as the input object file but with the file extension GFX or MIC added. If both GFX and MIC target executables are embedded both will be extracted. For example,

offload_extract host.exe => hostGFX.gfx and/or hostMIC.mic

Note

To extract the target object files from an archived library, you must first extract the individual fat objects from the fat archived library and then invoke the offload extract tool on the individual fat objects. For example:

ar -x libhost.a
offload_extract <individual fat host object>

Using Options

There are two options you can use to fine tune your extraction of offload binaries or executables.

Use the -o option to specify target filename or output directory. The syntax for the option is as follows:

offload_extract <fat host object|binary> [-o <output filename>]
offload_extract <fat host object|binary> [–o <output directory>]

When you use the -o option the target output filename and directory are generated without the GFX and MIC substring.

Use the -target option to select specific target GFX or MIC objects/executables to be extracted. The syntax for the option is as follows:

offload_extract <fat host object|binary> [-target gfx]
offload_extract <fat host object|binary> [–target mic]