mirror-llvm-project/offload/liboffload
Joseph Huber 14ec3c42ce
[Offload] add 'olIterateSymbols' runtime function (#213036)
Summary:
This provides users with a way to check all symbols present in a given
program. This is useful for many cases where a power user wants to do
something dynamic with the objects present.
2026-07-31 14:29:06 -05:00
..
API [Offload] add 'olIterateSymbols' runtime function (#213036) 2026-07-31 14:29:06 -05:00
include [Offload] Check for initialization (#144370) 2025-06-20 09:04:50 -05:00
src [Offload] add 'olIterateSymbols' runtime function (#213036) 2026-07-31 14:29:06 -05:00
CMakeLists.txt [offload] Add Windows offload support (#187006) 2026-06-17 10:07:08 +02:00
exports Reland #118503: [Offload] Introduce offload-tblgen and initial new API implementation (#118614) 2024-12-05 09:34:04 +01:00
README.md [Offload] Add argument to 'olInit' for global configuration options (#181872) 2026-02-17 14:04:00 -06:00

Liboffload

This directory contains the implementation of the work-in-progress new API for Offload. It builds on top of the existing plugin implementations but provides a single level of abstraction suitable for implementation of many offloading language runtimes, rather than just OpenMP.

Testing liboffload

The main test suite for liboffload can be run with the check-offload-unit target, which runs the offload.unittests executable. The test suite will automatically run on every available device, but can be restricted to a single platform (CUDA, AMDGPU) with a command line argument:

$ ./offload.unittests --platform=CUDA

Tracing of Offload API calls can be enabled by setting the OFFLOAD_TRACE environment variable. This works with any program that uses liboffload.

$ OFFLOAD_TRACE=1 ./offload.unittests
---> olInit(nullptr)-> OL_SUCCESS
# etc

The host plugin is not currently supported.

Modifying liboffload

The main header (OffloadAPI.h) and some implementation details are autogenerated with tablegen. See the API definition README for implementation details.