From acc144998d650acbfda7e5919a1290de8f8c7735 Mon Sep 17 00:00:00 2001 From: Akshay Tondak Date: Thu, 2 Jan 2025 10:31:42 -0800 Subject: [PATCH] Addition of query for xrt_smi_configuration.json (#8671) Signed-off-by: Akshay Tondak --- src/runtime_src/core/common/query_requests.h | 32 ++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/runtime_src/core/common/query_requests.h b/src/runtime_src/core/common/query_requests.h index 94945f2abd7..783345bb2fe 100644 --- a/src/runtime_src/core/common/query_requests.h +++ b/src/runtime_src/core/common/query_requests.h @@ -55,6 +55,7 @@ enum class key_type instance, edge_vendor, device_class, + xrt_smi_config, xclbin_name, sequence_name, elf_name, @@ -525,6 +526,37 @@ struct edge_vendor : request } }; +/** + * Used to retieve the path to a configuration file required for the + * current device assuming a valid instance "type" is passed. The shim + * decides the appropriate path and name to return, absolving XRT of + * needing to know where to look. + * This structure can be extended to provide other configurations supporting xrt-smi + */ + +struct xrt_smi_config : request +{ + enum class type { + options_config + }; + + static std::string + enum_to_str(const type& type) + { + switch (type) { + case type::options_config: + return "options_config"; + } + return "unknown"; + } + using result_type = std::string; + static const key_type key = key_type::xrt_smi_config; + static const char* name() { return "xrt_smi_config"; } + + virtual std::any + get(const device*, const std::any& req_type) const override = 0; +}; + /** * Used to retrieve the path to an xclbin file required for the * current device assuming a valid xclbin "type" is passed. The shim