Skip to content
This repository was archived by the owner on Dec 24, 2024. It is now read-only.

Commit 773afe8

Browse files
josemonsalve2makslevental
authored andcommitted
rocr/aie: Adding a placeholder UUID for NPU devices
1 parent 22fd9e4 commit 773afe8

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

runtime/hsa-runtime/core/runtime/amd_aie_agent.cpp

+18
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,24 @@ hsa_status_t AieAgent::GetInfo(hsa_agent_info_t attribute, void *value) const {
211211
std::strcpy(reinterpret_cast<char *>(value), product_name_info_.c_str());
212212
break;
213213
}
214+
case HSA_AMD_AGENT_INFO_UUID: {
215+
// TODO: uuid_value needs to be obtained somehow
216+
uint64_t uuid_value = 0;
217+
218+
if (uuid_value == 0) {
219+
static const char uuid_tmp[] = "AIE-XX";
220+
snprintf(static_cast<char *>(value), sizeof(uuid_tmp), "%s", uuid_tmp);
221+
break;
222+
}
223+
224+
// Device supports UUID, build UUID string to return.
225+
constexpr std::size_t max_uuid_length = 36;
226+
static const char uuid_tmp[] = "AIE-";
227+
snprintf(static_cast<char *>(value), max_uuid_length + sizeof(uuid_tmp),
228+
"%s%036lX", uuid_tmp, uuid_value);
229+
break;
230+
}
231+
214232
case HSA_AMD_AGENT_INFO_ASIC_REVISION:
215233
*reinterpret_cast<uint32_t *>(value) = 0;
216234
break;

0 commit comments

Comments
 (0)