[llvm] [Offload] Generate `OffloadTypedGetInfo.inc` (PR #168615)

Andrei Elovikov via llvm-commits llvm-commits at lists.llvm.org
Wed Nov 19 10:17:15 PST 2025


aelovikov-intel wrote:

> Realistically all we need is a way to query the size from the runtime and then just make a template helper that passes a sufficient amount of data and casts it to the requested type. Do we have any runtime calls similar to that?

Sorry, I don't understand that. The problem is that liboffload might be returning an `int32_t` via `void *pOut` yet the consumer might be mistakenly thinking that it's a `float`. The sizes would match and there is no way (currently) to detect such mismatch. After this patch the consumer would be able to verify (i.e., `static_assert`) what type do those bytes in `pOut` actually represent.

https://github.com/llvm/llvm-project/pull/168615


More information about the llvm-commits mailing list