[llvm] [Offload] Introduce offload-tblgen and initial new API implementation (PR #108413)
Callum Fare via llvm-commits
llvm-commits at lists.llvm.org
Fri Oct 4 08:31:41 PDT 2024
callumfare wrote:
@jhuber6 I've reworked the implementation of errors based on the discussion in the last call. I'm away for the next 2 weeks and haven't had time to polish it and update the UR adapter so I've not added it to this branch/PR, but you can see the changes on my `offload_new_api_error_rework` branch here:
https://github.com/llvm/llvm-project/commit/1b53217ba4703aeae071a3056890e7ab952afe02 You can use the unit tests to play around with it.
Things are identical in terms of how implementation functions return errors, but the entry points now return a pointer to a error information struct, containing an error code and optionally an error detail string. Success is just `NULL`.
The WIP elements are:
* Printing is a bit janky but should work
* Need a better container type for the error structs to avoid duplication of repeated errors. The error strings are de-duplicated in a `llvm::StringSet`, but the error structs are just allocated and put in a vector. set/unordered_set aren't suitable because of invalidation guarantees and strict weak ordering requirements. I think it's doable with a wrapper over the error allocations, so no big deal, but I've run out of time
https://github.com/llvm/llvm-project/pull/108413
More information about the llvm-commits
mailing list