mirror-llvm-project/offload
Łukasz Plewa ecd8d61126
[Offload] Add olCreateContext / olDestroyContext / olGetContextInfo API (#209144)
Add the initial Context handle API to liboffload:
  - olCreateContext / olDestroyContext
  - olGetContextInfo / olGetContextInfoSize
  - OL_ERRC_INVALID_CONTEXT error code
  - OL_CONTEXT_INFO_{NUM_DEVICES,DEVICES,PLATFORM} queries
  
This is the first patch in a series. I decided to split the original
change into multiple smaller PRs to make the review process faster and
more manageable.
This patch introduces context management functions, but the context
handle is not used anywhere yet. The following patches will extend the
API to use contexts in:
``` c
  ol_result_t olMemAlloc(ol_context_handle_t, ol_device_handle_t, ol_alloc_type_t, size_t, void**);
  ol_result_t olMemFree(ol_context_handle_t, void*); ​
  ol_result_t olGetMemInfo(ol_context_handle_t, const void*, ol_mem_info_t, size_t, void*);​
  ol_result_t olGetMemInfoSize(ol_context_handle_t, const void*, ol_mem_info_t, size_t*);​
  ol_result_t olCreateQueue(ol_context_handle_t, ol_device_handle_t, ol_queue_handle_t*);
  ol_result_t olCreateProgram(ol_context_handle_t, ol_device_handle_t, const void*, size_t, ol_program_handle_t*); 
```

You can also take a look at #201398, which contains the first version of
the complete change. I'm cleaning it up as I go, so the patches in this
series are not a direct 1:1 split of that PR.
2026-07-27 11:30:23 +02:00
..
ci [OpenMP][AMDGPU][CI] Fix libc build (#209336) 2026-07-13 23:46:24 +00:00
cmake [AMDGPU] Fix cache files and builds after amdgcn->amdgpu conversion (#209247) 2026-07-13 12:20:49 -05:00
docs [docs] Finish misc MyST migration (#210209) 2026-07-17 11:56:59 -07:00
include [Offload] Unify the kernel argument passing (#205224) 2026-06-25 15:51:30 -05:00
liboffload [Offload] Add olCreateContext / olDestroyContext / olGetContextInfo API (#209144) 2026-07-27 11:30:23 +02:00
libomptarget [Offload][OpenMP] Skip RPC callback registration when plugin has no devices (#211447) 2026-07-23 02:30:22 +00:00
plugins-nextgen [Offload] Add olCreateContext / olDestroyContext / olGetContextInfo API (#209144) 2026-07-27 11:30:23 +02:00
test [LLVM] Remove 'LLVM_LIBC_GPU_BUILD' logic (#211265) 2026-07-22 11:11:55 -05:00
tools [offload] Add the ability to record and replay IR bitcode modules (#207278) 2026-07-08 09:53:13 -07:00
unittests [Offload] Add olCreateContext / olDestroyContext / olGetContextInfo API (#209144) 2026-07-27 11:30:23 +02:00
utils
CMakeLists.txt [OFFLOAD] Add level_zero to list of default plugins (#210070) 2026-07-23 18:48:56 +02:00
Maintainers.md [Offload] Add 'Maintainers.md' file for offload (#138177) 2025-05-01 14:06:33 -05:00
README.md
README.txt

The LLVM/Offload Subproject

The Offload subproject aims at providing tooling, runtimes, and APIs that allow users to execute code on accelerators or other "co-processors" that may or may not match the architecture of their "host". In the long run, all kinds of targets are in scope of this effort, including but not limited to: CPUs, GPUs, FPGAs, AI/ML accelerators, distributed resources, etc.

For OpenMP offload users, the project is ready and fully usable. The final API design is still under development. More content will show up here and on our webpage soon. In the meantime, people are encouraged to participate in our meetings (see below) and check our development board as well as the discussions on Discourse.

Meetings

Every second Wednesday, 7:00 - 8:00am PT, starting Jan 24, 2024. Alternates with the OpenMP in LLVM meeting. invite.ics Meeting Minutes and Agenda