From 773afe8e4436057e77550eb6f43779e9918008f1 Mon Sep 17 00:00:00 2001 From: Jose Manuel Monsalve Diaz Date: Fri, 9 Aug 2024 14:17:57 -0700 Subject: [PATCH] rocr/aie: Adding a placeholder UUID for NPU devices --- .../hsa-runtime/core/runtime/amd_aie_agent.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/runtime/hsa-runtime/core/runtime/amd_aie_agent.cpp b/runtime/hsa-runtime/core/runtime/amd_aie_agent.cpp index cd374c65c..6868ef8ec 100644 --- a/runtime/hsa-runtime/core/runtime/amd_aie_agent.cpp +++ b/runtime/hsa-runtime/core/runtime/amd_aie_agent.cpp @@ -211,6 +211,24 @@ hsa_status_t AieAgent::GetInfo(hsa_agent_info_t attribute, void *value) const { std::strcpy(reinterpret_cast(value), product_name_info_.c_str()); break; } + case HSA_AMD_AGENT_INFO_UUID: { + // TODO: uuid_value needs to be obtained somehow + uint64_t uuid_value = 0; + + if (uuid_value == 0) { + static const char uuid_tmp[] = "AIE-XX"; + snprintf(static_cast(value), sizeof(uuid_tmp), "%s", uuid_tmp); + break; + } + + // Device supports UUID, build UUID string to return. + constexpr std::size_t max_uuid_length = 36; + static const char uuid_tmp[] = "AIE-"; + snprintf(static_cast(value), max_uuid_length + sizeof(uuid_tmp), + "%s%036lX", uuid_tmp, uuid_value); + break; + } + case HSA_AMD_AGENT_INFO_ASIC_REVISION: *reinterpret_cast(value) = 0; break;