<feed xmlns='http://www.w3.org/2005/Atom'>
<title>llvm-project.git/offload/liboffload/API/Common.td, branch main</title>
<subtitle>Unnamed repository; edit this file 'description' to name the repository.
</subtitle>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/'/>
<entry>
<title>[Offload] Lazily initialize platforms in the Offloading API (#163272)</title>
<updated>2025-10-14T14:35:53+00:00</updated>
<author>
<name>Joseph Huber</name>
<email>huberjn@outlook.com</email>
</author>
<published>2025-10-14T14:35:53+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4a35c4d38af4844f26d944047ca1f6aefd6a0eff'/>
<id>4a35c4d38af4844f26d944047ca1f6aefd6a0eff</id>
<content type='text'>
Summary:
The Offloading library wraps around the underlying plugins. The problem
is that we currently initialize all plugins we find, even if they are
not needed for the program. This is very expensive for trivial uses, as
fully heterogenous usage is quite rare. In practice this means that you
will always pay a 200 ms penalty for having CUDA installed.

This patch changes the behavior to provide accessors into the plugins
and devices that allows them to be initialized lazily. We use a
once_flag, this should properly take a fast-path check while still
blocking on concurrent use.

Making full use of this will require a way to filter platforms more
specifically. I'm thinking of what this would look like as an API.
I'm thinking that we either have an extra iterate function that takes a
callback on the platform, or we just provide a helper to find all the
devices that can run a given image. Maybe both?

Fixes: https://github.com/llvm/llvm-project/issues/159636</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Summary:
The Offloading library wraps around the underlying plugins. The problem
is that we currently initialize all plugins we find, even if they are
not needed for the program. This is very expensive for trivial uses, as
fully heterogenous usage is quite rare. In practice this means that you
will always pay a 200 ms penalty for having CUDA installed.

This patch changes the behavior to provide accessors into the plugins
and devices that allows them to be initialized lazily. We use a
once_flag, this should properly take a fast-path check while still
blocking on concurrent use.

Making full use of this will require a way to filter platforms more
specifically. I'm thinking of what this would look like as an API.
I'm thinking that we either have an extra iterate function that takes a
callback on the platform, or we just provide a helper to find all the
devices that can run a given image. Maybe both?

Fixes: https://github.com/llvm/llvm-project/issues/159636</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload][NFC] Use tablegen names rather than `name` parameter for API (#154736)</title>
<updated>2025-08-22T10:13:57+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-08-22T10:13:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=17dbb92612db6dcf9746cf494d37476b93e49a49'/>
<id>17dbb92612db6dcf9746cf494d37476b93e49a49</id>
<content type='text'>
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload][NFC] Use a sensible order for APIGen (#154518)</title>
<updated>2025-08-21T08:38:21+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-08-21T08:38:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=2e74cc6c04fc61b5524d3b17a4eff53bffa1b207'/>
<id>2e74cc6c04fc61b5524d3b17a4eff53bffa1b207</id>
<content type='text'>
The order entries in the tablegen API files are iterated is not the
order
they appear in the file. To avoid any issues with the order changing
in future, we now generate all definitions of a certain class before
class that can use them.

This is a NFC; the definitions don't actually change, just the order
they exist in in the OffloadAPI.h header.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The order entries in the tablegen API files are iterated is not the
order
they appear in the file. To avoid any issues with the order changing
in future, we now generate all definitions of a certain class before
class that can use them.

This is a NFC; the definitions don't actually change, just the order
they exist in in the OffloadAPI.h header.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Change `ol_kernel_handle_t` -&gt; `ol_symbol_handle_t` (#147943)</title>
<updated>2025-07-10T13:54:10+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-07-10T13:54:10+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=466357ab51609bceaf40daa04e2a4a9fe409939e'/>
<id>466357ab51609bceaf40daa04e2a4a9fe409939e</id>
<content type='text'>
In the future, we want `ol_symbol_handle_t` to represent both kernels
and global variables The first step in this process is a rename and
promotion to a "typed handle".</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
In the future, we want `ol_symbol_handle_t` to represent both kernels
and global variables The first step in this process is a rename and
promotion to a "typed handle".</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Add Offload API Sphinx documentation (#147323)</title>
<updated>2025-07-10T10:50:51+00:00</updated>
<author>
<name>Kenneth Benzie (Benie)</name>
<email>k.benzie83@gmail.com</email>
</author>
<published>2025-07-10T10:50:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=cea33304c0ea7fdcd40c7ad6cfeef813d3c9f5e5'/>
<id>cea33304c0ea7fdcd40c7ad6cfeef813d3c9f5e5</id>
<content type='text'>
* Add spec generation to offload-tblgen tool
* This patch adds generation of Sphinx compatible reStructuedText
utilizing the C domain to document the Offload API directly from the
spec definition `.td` files.
* Add Sphinx HTML documentation target
* Introduces the `docs-offload-html` target when CMake is configured
with `LLVM_ENABLE_SPHINX=ON` and `SPHINX_OUTPUT_HTML=ON`. Utilized
`offload-tblgen -gen-spen` to generate Offload API specification docs.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
* Add spec generation to offload-tblgen tool
* This patch adds generation of Sphinx compatible reStructuedText
utilizing the C domain to document the Offload API directly from the
spec definition `.td` files.
* Add Sphinx HTML documentation target
* Introduces the `docs-offload-html` target when CMake is configured
with `LLVM_ENABLE_SPHINX=ON` and `SPHINX_OUTPUT_HTML=ON`. Utilized
`offload-tblgen -gen-spen` to generate Offload API specification docs.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Add missing license header to Common.td (#146737)</title>
<updated>2025-07-02T16:17:30+00:00</updated>
<author>
<name>Callum Fare</name>
<email>callum@codeplay.com</email>
</author>
<published>2025-07-02T16:17:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=3c0571a749711226922f8b587fd9b1e5985dc6c4'/>
<id>3c0571a749711226922f8b587fd9b1e5985dc6c4</id>
<content type='text'>
All other tablegen files in this directory have the license header, but
`Common.td` is missing it</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All other tablegen files in this directory have the license header, but
`Common.td` is missing it</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Implement `olShutDown` (#144055)</title>
<updated>2025-06-30T11:14:00+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-06-30T11:14:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=003145d0c8d5417d7b7ef1eb40838bc0fb50e229'/>
<id>003145d0c8d5417d7b7ef1eb40838bc0fb50e229</id>
<content type='text'>
`olShutDown` was not properly calling deinit on the platforms, resulting
in random segfaults on AMD devices.

As part of this, `olInit` and `olShutDown` now alloc and free the
offload context rather than it being static. This
allows `olShutDown` to be called within a destructor of a static object
(like the tests do) without having to worry about destructor ordering.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
`olShutDown` was not properly calling deinit on the platforms, resulting
in random segfaults on AMD devices.

As part of this, `olInit` and `olShutDown` now alloc and free the
offload context rather than it being static. This
allows `olShutDown` to be called within a destructor of a static object
(like the tests do) without having to worry about destructor ordering.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Properly report errors when jit compiling (#145498)</title>
<updated>2025-06-24T15:27:12+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-06-24T15:27:12+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4359e55838cd29d4aa344f15543f725da25e940f'/>
<id>4359e55838cd29d4aa344f15543f725da25e940f</id>
<content type='text'>
Previously, if a binary failed to load due to failures when jit
compiling, the function would return success with nullptr. Now it
returns a new plugin error, `COMPILE_FAILURE`.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Previously, if a binary failed to load due to failures when jit
compiling, the function would return success with nullptr. Now it
returns a new plugin error, `COMPILE_FAILURE`.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Check for initialization (#144370)</title>
<updated>2025-06-20T14:04:50+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-06-20T14:04:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=e0633d59b9d0f931d3917e51a51b5aa7d7e775ac'/>
<id>e0633d59b9d0f931d3917e51a51b5aa7d7e775ac</id>
<content type='text'>
All entry points (except olInit) now check that offload has been
initialized. If not, a new `OL_ERRC_UNINITIALIZED` error is returned.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
All entry points (except olInit) now check that offload has been
initialized. If not, a new `OL_ERRC_UNINITIALIZED` error is returned.</pre>
</div>
</content>
</entry>
<entry>
<title>[Offload] Add `ol_dimensions_t` and convert ranges from size_t -&gt; uint32_t (#143901)</title>
<updated>2025-06-12T14:59:59+00:00</updated>
<author>
<name>Ross Brunton</name>
<email>ross@codeplay.com</email>
</author>
<published>2025-06-12T14:59:59+00:00</published>
<link rel='alternate' type='text/html' href='https://git.belthelziquor.com/llvm-project.git/commit/?id=4f60321ca183ebf132e97e54d8d560643c5c3340'/>
<id>4f60321ca183ebf132e97e54d8d560643c5c3340</id>
<content type='text'>
This is a three element x, y, z size_t vector that can be used any place
where a 3D vector is required. This ensures that all vectors across
liboffload are the same and don't require any resizing/reordering
dances.</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a three element x, y, z size_t vector that can be used any place
where a 3D vector is required. This ensures that all vectors across
liboffload are the same and don't require any resizing/reordering
dances.</pre>
</div>
</content>
</entry>
</feed>
