[llvm] [Offload] Add `MAX_WORK_GROUP_SIZE` device info query (PR #143718)
Ross Brunton via llvm-commits
llvm-commits at lists.llvm.org
Wed Jun 25 05:54:57 PDT 2025
================
@@ -264,13 +266,16 @@ Error olGetDeviceInfoImplDetail(ol_device_handle_t Device,
return "";
};
- auto GetInfoXyz = [&](std::vector<std::string> Names) {
- if (!Device->Device)
- return ol_dimensions_t{0, 0, 0};
+ auto GetInfoXyz = [&](std::vector<std::string> Names) -> Error {
+ if (Device == OffloadContext::get().HostDevice())
+ return ReturnValue(ol_dimensions_t{0u, 0u, 0u});
----------------
RossBrunton wrote:
`ReturnValue` is a helper object with an `operator()` that automatically writes the value to `PropValue` and `PropSizeRet` as appropriate (as well as doing some validation checks).
If this were to return `Expected<ol_dimensions_t>`, then the callers would have to do the Error unwrapping themselves.
@callumfare For the sake of clarity, do you mind if (in a separate patch) I rename this to something like `SetOutput`?
https://github.com/llvm/llvm-project/pull/143718
More information about the llvm-commits
mailing list