SWDEV-325709 - Testing hipDeviceAttributeFineGrainSupport property (#2637)

Added a test to check hipDeviceAttributeFineGrainSupport property.

Change-Id: I9750ef5494e22f4eb7305e1719be9712a3079c37
이 커밋은 다음에 포함됨:
ROCm CI Service Account 작성하고 GitHub가 2022-05-17 12:53:25 +05:30를 커밋함
1 부모 fc3f1e2d20
커밋 9169520aaa
1 파일이 변경됨
+34
+34
파일 보기
@@ -231,6 +231,40 @@ TEST_CASE("Unit_hipGetDeviceAttribute_CheckAttrValues") {
props.texturePitchAlignment));
}
/**
* Validate the hipDeviceAttributeFineGrainSupport property in AMD.
*/
#if HT_AMD
// This is AMD specific property test
TEST_CASE("Unit_hipGetDeviceAttribute_CheckFineGrainSupport") {
int deviceId;
int deviceCount = 0;
HIP_CHECK(hipGetDeviceCount(&deviceCount));
REQUIRE(deviceCount > 0);
// Check hipDeviceAttributeFineGrainSupport for all available device
// in system.
for (int dev = 0; dev < deviceCount; dev++) {
HIP_CHECK(hipSetDevice(dev));
HIP_CHECK(hipGetDevice(&deviceId));
hipDeviceProp_t props;
HIP_CHECK(hipGetDeviceProperties(&props, deviceId));
int value = 0;
HIP_CHECK(hipDeviceGetAttribute(&value,
hipDeviceAttributeFineGrainSupport, deviceId));
std::string gpu_arch_name(props.gcnArchName);
if (std::string::npos != gpu_arch_name.find("gfx90a")) {
// Current GPU is gfx90a architecture
REQUIRE(value == 1);
} else if (std::string::npos != gpu_arch_name.find("gfx906")) {
// Current GPU is gfx906 architecture
REQUIRE(value == 0);
} else if (std::string::npos != gpu_arch_name.find("gfx908")) {
// Current GPU is gfx908 architecture
REQUIRE(value == 0);
}
}
}
#endif
/**
* Validates negative scenarios for hipDeviceGetAttribute
* scenario1: pi = nullptr