SWDEV-317716 - Add hipDeviceGetUuid API

Change-Id: I320c7bc11ddd7617e0246f6faf19135ad7363e73
This commit is contained in:
Satyanvesh Dittakavi
2022-01-13 14:06:44 +00:00
zatwierdzone przez Maneesh Gupta
rodzic af18c3144f
commit 3eca517625
@@ -1,5 +1,5 @@
/*
Copyright (c) 2015 - 2021 Advanced Micro Devices, Inc. All rights reserved.
Copyright (c) 2015 - 2022 Advanced Micro Devices, Inc. All rights reserved.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
@@ -2089,6 +2089,18 @@ inline static hipError_t hipDeviceGetName(char* name, int len, hipDevice_t devic
return hipCUResultTohipError(cuDeviceGetName(name, len, device));
}
inline static hipError_t hipDeviceGetUuid(hipUUID* uuid, hipDevice_t device) {
if (uuid == NULL) {
return hipErrorInvalidValue;
}
struct CUuuid_st CUuid;
hipError_t err = hipCUResultTohipError(cuDeviceGetUuid(&CUuid, device));
if (err == hipSuccess) {
strncpy(uuid->bytes, CUuid.bytes, 16);
}
return err;
}
inline static hipError_t hipDeviceGetP2PAttribute(int* value, hipDeviceP2PAttr attr,
int srcDevice, int dstDevice) {
return hipCUDAErrorTohipError(cudaDeviceGetP2PAttribute(value, attr, srcDevice, dstDevice));