From 569a4cac67ba9a26ee2b0d631fe14d6608ac8310 Mon Sep 17 00:00:00 2001 From: Ioannis Assiouras Date: Fri, 22 Nov 2024 11:23:30 +0000 Subject: [PATCH] SWDEV-500124 - Removed Unit_hipHostAlloc_AllocateUseMoreThanAvailGPUMemory Change-Id: I549ec451df2211378f421f35abc822d02cb0af24 [ROCm/hip-tests commit: ab395147d22dc4a349d993078501a0b860646987] --- .../catch/unit/memory/hipHostAlloc.cc | 49 ------------------- 1 file changed, 49 deletions(-) diff --git a/projects/hip-tests/catch/unit/memory/hipHostAlloc.cc b/projects/hip-tests/catch/unit/memory/hipHostAlloc.cc index 53e0d1934d..a7d0a03828 100644 --- a/projects/hip-tests/catch/unit/memory/hipHostAlloc.cc +++ b/projects/hip-tests/catch/unit/memory/hipHostAlloc.cc @@ -38,11 +38,6 @@ static constexpr int NUMELEMENTS{1024 * 16}; static constexpr size_t SIZEBYTES{NUMELEMENTS * sizeof(int)}; static std::vector syncMsg = {"event", "stream", "device"}; -static __global__ void kerTestMemAccess(char *buf) { - size_t myId = threadIdx.x + blockDim.x * blockIdx.x; - buf[myId] = VALUE; -} - static void CheckHostPointer(int NUMELEMENTS, int *ptr, unsigned eventFlags, int syncMethod, std::string msg) { INFO("test: CheckHostPointer " @@ -361,50 +356,6 @@ TEST_CASE("Unit_hipHostAlloc_AllocateMoreThanAvailGPUMemory") { } } -/** - * Test Description - * ------------------------ - * - This testcase verifies the hipHostAlloc API by: - * Allocating more memory than the total GPU memory. - * Validating memory access in a device function. - * Test source - * ------------------------ - * - unit/memory/hipHostAlloc.cc - * Test requirements - * ------------------------ - * - HIP_VERSION >= 6.3 - */ -#if HT_AMD -TEST_CASE("Unit_hipHostAlloc_AllocateUseMoreThanAvailGPUMemory") { - char *A = nullptr; - size_t maxGpuMem = 0, availableMem = 0; - // Get available GPU memory and total GPU memory - HIP_CHECK(hipMemGetInfo(&availableMem, &maxGpuMem)); -#if defined(_WIN32) - size_t allocsize = availableMem - (256 * 1024 * 1024); - allocsize -= allocsize * (MEMORY_PERCENT / 100.0); -#else - size_t allocsize = maxGpuMem + ((maxGpuMem * MEMORY_PERCENT) / 100); -#endif - // Get free host In bytes - size_t hostMemFree = HipTest::getMemoryAmount() * 1024 * 1024; - // Ensure that allocsize < hostMemFree - if (allocsize > hostMemFree) { - allocsize = 0.9f * hostMemFree; - } - HIP_CHECK(hipHostAlloc(reinterpret_cast(&A), allocsize, - hipHostMallocDefault)); - constexpr int sample_size = 1024; - // memset a sample size to 0 - HIP_CHECK(hipMemset(A, 0, sample_size)); - unsigned int grid_size = allocsize / BLOCK_SIZE; - // Check if the allocated memory can be accessed in kernels - kerTestMemAccess<<>>(A); - HIP_CHECK(hipDeviceSynchronize()); - HIP_CHECK(hipHostFree(A)); -} -#endif - /** * Test Description * ------------------------