From 7ed657c2afaff09f48cc2009cc8c963bb47e8591 Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Wed, 17 Jul 2024 17:16:11 +0100 Subject: [PATCH] SWDEV-474159 - Query max LDS in Unit_hipDynamicShared Change-Id: Ie78613ea1a87d69aff4f764368ea7a1893e021f5 [ROCm/hip-tests commit: 5e26ec0bb13b22b8fe754be4ccf2ab525d163f98] --- .../catch/include/hip_test_common.hh | 21 ------------------- .../catch/unit/kernel/hipDynamicShared.cc | 11 ++++------ 2 files changed, 4 insertions(+), 28 deletions(-) diff --git a/projects/hip-tests/catch/include/hip_test_common.hh b/projects/hip-tests/catch/include/hip_test_common.hh index eb7690efb8..97a16f7be8 100644 --- a/projects/hip-tests/catch/include/hip_test_common.hh +++ b/projects/hip-tests/catch/include/hip_test_common.hh @@ -237,27 +237,6 @@ static inline bool IsGfx11() { #endif } -static inline bool IsMi350() { -#if HT_NVIDIA - return false; -#elif HT_AMD - int device = -1; - hipDeviceProp_t props{}; - HIP_CHECK(hipGetDevice(&device)); - HIP_CHECK(hipGetDeviceProperties(&props, device)); - // Get GCN Arch Name and compare to check if it is gfx11 - std::string arch = std::string(props.gcnArchName); - auto pos = arch.find("gfx950"); - if (pos != std::string::npos) - return true; - else - return false; -#else - std::cout << "Have to be either Nvidia or AMD platform, asserting" << std::endl; - assert(false); -#endif -} - // Utility Functions namespace HipTest { static inline int getDeviceCount() { diff --git a/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc b/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc index 8f9324ba2a..e25938d51c 100644 --- a/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc +++ b/projects/hip-tests/catch/unit/kernel/hipDynamicShared.cc @@ -163,13 +163,10 @@ TEST_CASE("Unit_hipDynamicShared") { } SECTION("test case with float for max LDS size") { - if(IsMi350()) - { - testExternShared(1024, 160*1024/sizeof(float)); - }else - { - testExternShared(1024, 64*1024/sizeof(float)); - } + int maxLDS = 0; + HIP_CHECK(hipDeviceGetAttribute(&maxLDS, + hipDeviceAttributeMaxSharedMemoryPerBlock, 0)); + testExternShared(1024, maxLDS/sizeof(float)); } }