Skip to content

Commit

Permalink
rocr/aie: Adding a placeholder UUID for NPU devices
Browse files Browse the repository at this point in the history
  • Loading branch information
josemonsalve2 authored and makslevental committed Sep 1, 2024
1 parent 22fd9e4 commit 773afe8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions runtime/hsa-runtime/core/runtime/amd_aie_agent.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,24 @@ hsa_status_t AieAgent::GetInfo(hsa_agent_info_t attribute, void *value) const {
std::strcpy(reinterpret_cast<char *>(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<char *>(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<char *>(value), max_uuid_length + sizeof(uuid_tmp),
"%s%036lX", uuid_tmp, uuid_value);
break;
}

case HSA_AMD_AGENT_INFO_ASIC_REVISION:
*reinterpret_cast<uint32_t *>(value) = 0;
break;
Expand Down

0 comments on commit 773afe8

Please sign in to comment.