[all-commits] [llvm/llvm-project] 800d94: [Offload] Implement the remaining initial Offload ...

Callum Fare via All-commits all-commits at lists.llvm.org
Tue Apr 22 11:28:12 PDT 2025


  Branch: refs/heads/main
  Home:   https://github.com/llvm/llvm-project
  Commit: 800d949bb315349a116a980e99d0f36645ffefd3
      https://github.com/llvm/llvm-project/commit/800d949bb315349a116a980e99d0f36645ffefd3
  Author: Callum Fare <callum at codeplay.com>
  Date:   2025-04-22 (Tue, 22 Apr 2025)

  Changed paths:
    M offload/liboffload/API/APIDefs.td
    M offload/liboffload/API/Common.td
    M offload/liboffload/API/Device.td
    A offload/liboffload/API/Event.td
    A offload/liboffload/API/Kernel.td
    A offload/liboffload/API/Memory.td
    M offload/liboffload/API/OffloadAPI.td
    M offload/liboffload/API/Platform.td
    A offload/liboffload/API/Program.td
    A offload/liboffload/API/Queue.td
    M offload/liboffload/API/README.md
    M offload/liboffload/include/OffloadImpl.hpp
    M offload/liboffload/include/generated/OffloadAPI.h
    M offload/liboffload/include/generated/OffloadEntryPoints.inc
    M offload/liboffload/include/generated/OffloadFuncs.inc
    M offload/liboffload/include/generated/OffloadImplFuncDecls.inc
    M offload/liboffload/include/generated/OffloadPrint.hpp
    M offload/liboffload/src/OffloadImpl.cpp
    M offload/liboffload/src/OffloadLib.cpp
    M offload/test/tools/offload-tblgen/entry_points.td
    M offload/test/tools/offload-tblgen/functions_ranged_param.td
    M offload/test/tools/offload-tblgen/print_enum.td
    M offload/test/tools/offload-tblgen/print_function.td
    M offload/test/tools/offload-tblgen/type_tagged_enum.td
    M offload/tools/offload-tblgen/APIGen.cpp
    M offload/tools/offload-tblgen/EntryPointGen.cpp
    M offload/tools/offload-tblgen/PrintGen.cpp
    M offload/tools/offload-tblgen/RecordTypes.hpp
    M offload/unittests/OffloadAPI/CMakeLists.txt
    M offload/unittests/OffloadAPI/common/Environment.cpp
    M offload/unittests/OffloadAPI/common/Environment.hpp
    M offload/unittests/OffloadAPI/common/Fixtures.hpp
    R offload/unittests/OffloadAPI/device/olGetDevice.cpp
    R offload/unittests/OffloadAPI/device/olGetDeviceCount.cpp
    M offload/unittests/OffloadAPI/device/olGetDeviceInfo.cpp
    M offload/unittests/OffloadAPI/device/olGetDeviceInfoSize.cpp
    A offload/unittests/OffloadAPI/device/olIterateDevices.cpp
    A offload/unittests/OffloadAPI/device_code/CMakeLists.txt
    A offload/unittests/OffloadAPI/device_code/bar.c
    A offload/unittests/OffloadAPI/device_code/foo.c
    A offload/unittests/OffloadAPI/kernel/olGetKernel.cpp
    A offload/unittests/OffloadAPI/kernel/olLaunchKernel.cpp
    A offload/unittests/OffloadAPI/memory/olMemAlloc.cpp
    A offload/unittests/OffloadAPI/memory/olMemFree.cpp
    A offload/unittests/OffloadAPI/memory/olMemcpy.cpp
    R offload/unittests/OffloadAPI/platform/olGetPlatform.cpp
    R offload/unittests/OffloadAPI/platform/olGetPlatformCount.cpp
    M offload/unittests/OffloadAPI/platform/olGetPlatformInfo.cpp
    M offload/unittests/OffloadAPI/platform/olGetPlatformInfoSize.cpp
    M offload/unittests/OffloadAPI/platform/olPlatformInfo.hpp
    A offload/unittests/OffloadAPI/program/olCreateProgram.cpp
    A offload/unittests/OffloadAPI/program/olDestroyProgram.cpp
    A offload/unittests/OffloadAPI/queue/olCreateQueue.cpp
    A offload/unittests/OffloadAPI/queue/olDestroyQueue.cpp
    A offload/unittests/OffloadAPI/queue/olWaitQueue.cpp

  Log Message:
  -----------
  [Offload] Implement the remaining initial Offload API (#122106)

Implement the complete initial version of the Offload API, to the extent
that is usable for simple offloading programs. Tested with a basic SYCL
program.

As far as possible, these are simple wrappers over existing
functionality in the plugins.

* Allocating and freeing memory (host, device, shared).
* Creating a program 
* Creating a queue (wrapper over asynchronous stream resource)
* Enqueuing memcpy operations
* Enqueuing kernel executions
* Waiting on (optional) output events from the enqueue operations
* Waiting on a queue to finish

Objects created with the API have reference counting semantics to handle
their lifetime. They are created with an initial reference count of 1,
which can be incremented and decremented with retain and release
functions. They are freed when their reference count reaches 0. Platform
and device objects are not reference counted, as they are expected to
persist as long as the library is in use, and it's not meaningful for
users to create or destroy them.

Tests have been added to `offload.unittests`, including device code for
testing program and kernel related functionality.

The API should still be considered unstable and it's very likely we will
need to change the existing entry points.



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