SWDEV-317716 - Add hipDeviceGetUuid API

Change-Id: I320c7bc11ddd7617e0246f6faf19135ad7363e73
Этот коммит содержится в:
Satyanvesh Dittakavi authored and Maneesh Gupta committed 2022-03-16 00:23:44 -04:00
1 родитель 4117655e91
Коммит 2fd90ec7a4
6 files changed
+163 -32

No files matched your search

+19
Просмотреть файл
@@ -149,6 +149,25 @@ hipError_t hipDeviceGetName(char *name, int len, hipDevice_t device) {
HIP_RETURN(hipSuccess);
}
hipError_t hipDeviceGetUuid(hipUUID* uuid, hipDevice_t device) {
HIP_INIT_API(hipDeviceGetUuid, reinterpret_cast<void*>(uuid), device);
if (device < 0 || static_cast<size_t>(device) >= g_devices.size()) {
HIP_RETURN(hipErrorInvalidDevice);
}
if (uuid == nullptr) {
HIP_RETURN(hipErrorInvalidValue);
}
auto* deviceHandle = g_devices[device]->devices()[0];
const auto& info = deviceHandle->info();
::strncpy(uuid->bytes, info.uuid_, 16);
HIP_RETURN(hipSuccess);
}
hipError_t ihipGetDeviceProperties(hipDeviceProp_t* props, hipDevice_t device) {
if (props == nullptr) {
return hipErrorInvalidValue;