[all-commits] [llvm/llvm-project] fd3907: Reland #118503: [Offload] Introduce offload-tblgen...

Callum Fare via All-commits all-commits at lists.llvm.org
Thu Dec 5 00:34:27 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: fd3907ccb583df99e9c19d2fe84e4e7c52d75de9
      https://github.com/llvm/llvm-project/commit/fd3907ccb583df99e9c19d2fe84e4e7c52d75de9
  Author: Callum Fare <callum at codeplay.com>
  Date:   2024-12-05 (Thu, 05 Dec 2024)

  Changed paths:
    M offload/CMakeLists.txt
    M offload/cmake/OpenMPTesting.cmake
    A offload/liboffload/API/APIDefs.td
    A offload/liboffload/API/CMakeLists.txt
    A offload/liboffload/API/Common.td
    A offload/liboffload/API/Device.td
    A offload/liboffload/API/OffloadAPI.td
    A offload/liboffload/API/Platform.td
    A offload/liboffload/API/README.md
    A offload/liboffload/CMakeLists.txt
    A offload/liboffload/README.md
    A offload/liboffload/exports
    A offload/liboffload/include/OffloadImpl.hpp
    A offload/liboffload/include/generated/OffloadAPI.h
    A offload/liboffload/include/generated/OffloadEntryPoints.inc
    A offload/liboffload/include/generated/OffloadFuncs.inc
    A offload/liboffload/include/generated/OffloadImplFuncDecls.inc
    A offload/liboffload/include/generated/OffloadPrint.hpp
    A offload/liboffload/src/Helpers.hpp
    A offload/liboffload/src/OffloadImpl.cpp
    A offload/liboffload/src/OffloadLib.cpp
    M offload/plugins-nextgen/common/include/PluginInterface.h
    M offload/test/lit.cfg
    M offload/test/lit.site.cfg.in
    A offload/test/tools/offload-tblgen/default_returns.td
    A offload/test/tools/offload-tblgen/entry_points.td
    A offload/test/tools/offload-tblgen/functions_basic.td
    A offload/test/tools/offload-tblgen/functions_code_loc.td
    A offload/test/tools/offload-tblgen/functions_ranged_param.td
    A offload/test/tools/offload-tblgen/print_enum.td
    A offload/test/tools/offload-tblgen/print_function.td
    A offload/test/tools/offload-tblgen/type_tagged_enum.td
    A offload/tools/offload-tblgen/APIGen.cpp
    A offload/tools/offload-tblgen/CMakeLists.txt
    A offload/tools/offload-tblgen/EntryPointGen.cpp
    A offload/tools/offload-tblgen/FuncsGen.cpp
    A offload/tools/offload-tblgen/GenCommon.hpp
    A offload/tools/offload-tblgen/Generators.hpp
    A offload/tools/offload-tblgen/PrintGen.cpp
    A offload/tools/offload-tblgen/RecordTypes.hpp
    A offload/tools/offload-tblgen/offload-tblgen.cpp
    M offload/unittests/CMakeLists.txt
    A offload/unittests/OffloadAPI/CMakeLists.txt
    A offload/unittests/OffloadAPI/common/Environment.cpp
    A offload/unittests/OffloadAPI/common/Environment.hpp
    A offload/unittests/OffloadAPI/common/Fixtures.hpp
    A offload/unittests/OffloadAPI/device/olDeviceInfo.hpp
    A offload/unittests/OffloadAPI/device/olGetDevice.cpp
    A offload/unittests/OffloadAPI/device/olGetDeviceCount.cpp
    A offload/unittests/OffloadAPI/device/olGetDeviceInfo.cpp
    A offload/unittests/OffloadAPI/device/olGetDeviceInfoSize.cpp
    A offload/unittests/OffloadAPI/platform/olGetPlatform.cpp
    A offload/unittests/OffloadAPI/platform/olGetPlatformCount.cpp
    A offload/unittests/OffloadAPI/platform/olGetPlatformInfo.cpp
    A offload/unittests/OffloadAPI/platform/olGetPlatformInfoSize.cpp
    A offload/unittests/OffloadAPI/platform/olPlatformInfo.hpp

  Log Message:
  -----------
  Reland #118503: [Offload] Introduce offload-tblgen and initial new API implementation (#118614)

Reland #118503. Added a fix for builds with `-DBUILD_SHARED_LIBS=ON`
(see last commit). Otherwise the changes are identical.

---


### New API

Previous discussions at the LLVM/Offload meeting have brought up the
need for a new API for exposing the functionality of the plugins. This
change introduces a very small subset of a new API, which is primarily
for testing the offload tooling and demonstrating how a new API can fit
into the existing code base without being too disruptive. Exact designs
for these entry points and future additions can be worked out over time.

The new API does however introduce the bare minimum functionality to
implement device discovery for Unified Runtime and SYCL. This means that
the `urinfo` and `sycl-ls` tools can be used on top of Offload. A
(rough) implementation of a Unified Runtime adapter (aka plugin) for
Offload is available
[here](https://github.com/callumfare/unified-runtime/tree/offload_adapter).
Our intention is to maintain this and use it to implement and test
Offload API changes with SYCL.

### Demoing the new API

```sh
# From the runtime build directory
$ ninja LibomptUnitTests
$ OFFLOAD_TRACE=1 ./offload/unittests/OffloadAPI/offload.unittests 
```


### Open questions and future work
* Only some of the available device info is exposed, and not all the
possible device queries needed for SYCL are implemented by the plugins.
A sensible next step would be to refactor and extend the existing device
info queries in the plugins. The existing info queries are all strings,
but the new API introduces the ability to return any arbitrary type.
* It may be sensible at some point for the plugins to implement the new
API directly, and the higher level code on top of it could be made
generic, but this is more of a long-term possibility.



To unsubscribe from these emails, change your notification settings at https://github.com/llvm/llvm-project/settings/notifications


More information about the All-commits mailing list