SWDEV-317716 - Add hipDeviceGetUuid API
Change-Id: I320c7bc11ddd7617e0246f6faf19135ad7363e73
This commit is contained in:
1 parent
4117655e91
commit
2fd90ec7a4
6 files changed
+163
-32
No files matched your search
@@ -27,6 +27,7 @@ hipDeviceGetCacheConfig
|
||||
hipDeviceGetStreamPriorityRange
|
||||
hipDeviceGetLimit
|
||||
hipDeviceGetName
|
||||
hipDeviceGetUuid
|
||||
hipDeviceGetPCIBusId
|
||||
hipDeviceGetSharedMemConfig
|
||||
hipDeviceGetP2PAttribute
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -27,6 +27,7 @@ hipDeviceGetCacheConfig
|
||||
hipDeviceGetStreamPriorityRange
|
||||
hipDeviceGetLimit
|
||||
hipDeviceGetName
|
||||
hipDeviceGetUuid
|
||||
hipDeviceGetPCIBusId
|
||||
hipDeviceGetSharedMemConfig
|
||||
hipDeviceGetP2PAttribute
|
||||
|
||||
@@ -396,3 +396,10 @@ global:
|
||||
local:
|
||||
*;
|
||||
} hip_4.5;
|
||||
|
||||
hip_5.1 {
|
||||
global:
|
||||
hipDeviceGetUuid;
|
||||
local:
|
||||
*;
|
||||
} hip_5.0;
|
||||
Reference in new issue
Block a user