SWDEV-465215 - fixes for hipFuncGetAttribute tests

Fixes SWDEV-465215, SWDEV-465213, SWDEV-465212

Change-Id: I08b114bf647366abcf900d6b2a17f77ca608fc46
This commit is contained in:
Ajay authored and Ajay GunaShekar committed 2025-01-24 16:08:09 -05:00
1 parent 58d4bd27a3
commit 6059eaa7c1
7 files changed
+1 -26

No files matched your search

@@ -34,13 +34,9 @@ TEST_CASE("Unit_hipFuncGetAttributes_Positive_Basic") {
HIP_CHECK(hipFuncGetAttributes(&attr, reinterpret_cast<void*>(attribute_test_kernel)));
SECTION("binaryVersion") {
#if HT_NVIDIA
const auto major = GetDeviceAttribute(hipDeviceAttributeComputeCapabilityMajor, 0);
const auto minor = GetDeviceAttribute(hipDeviceAttributeComputeCapabilityMinor, 0);
REQUIRE(attr.binaryVersion == major * 10 + minor);
#elif HT_AMD
REQUIRE(attr.binaryVersion > 0);
#endif
}
SECTION("cacheModeCA") { REQUIRE((attr.cacheModeCA == 0 || attr.cacheModeCA == 1)); }
@@ -181,7 +181,7 @@ TEST_CASE("Unit_hipFuncSetAttribute_Negative_Parameters") {
// The sum of this value and the function attribute sharedSizeBytes cannot exceed the device
// attribute cudaDevAttrMaxSharedMemoryPerBlockOptin
int max_shared;
HIP_CHECK(hipDeviceGetAttribute(&max_shared, hipDeviceAttributeMaxSharedMemoryPerBlock, 0));
HIP_CHECK(hipDeviceGetAttribute(&max_shared, hipDeviceAttributeSharedMemPerBlockOptin, 0));
hipFuncAttributes attributes;
HIP_CHECK(hipFuncGetAttributes(&attributes, reinterpret_cast<void*>(kernel)));
-4
View File
@@ -39,13 +39,9 @@ TEST_CASE("Unit_hipFuncGetAttribute_Positive_Basic") {
SECTION("binaryVersion") {
HIP_CHECK(hipFuncGetAttribute(&value, HIP_FUNC_ATTRIBUTE_BINARY_VERSION, kernel));
#if HT_NVIDIA
const auto major = GetDeviceAttribute(hipDeviceAttributeComputeCapabilityMajor, 0);
const auto minor = GetDeviceAttribute(hipDeviceAttributeComputeCapabilityMinor, 0);
REQUIRE(value == major * 10 + minor);
#elif HT_AMD
REQUIRE(value > 0);
#endif
}
SECTION("cacheModeCA") {