@@ -383,67 +383,6 @@ TEST_CASE("Unit_hipMemSetAccess_FuncTstOnMultDev") {
383383 }
384384}
385385
386- /* *
387- * Test Description
388- * ------------------------
389- * - Allocate physical memory and map it to a VMM range.
390- * Access (Read/Write) the virtual pointer directly on host.
391- * Ensure this behavior for all devices on host.
392- * ------------------------
393- * - unit/virtualMemoryManagement/hipMemMap.cc
394- * Test requirements
395- * ------------------------
396- * - HIP_VERSION >= 6.1
397- */
398- TEST_CASE (" Unit_hipMemSetAccess_AccessDirectlyFromHost" ) {
399- size_t granularity = 0 ;
400- constexpr int N = DATA_SIZE;
401- size_t buffer_size = N * sizeof (int );
402- int devicecount = 0 ;
403- HIP_CHECK (hipGetDeviceCount (&devicecount));
404- if (devicecount < 2 ) {
405- HipTest::HIP_SKIP_TEST (" Machine is Single GPU. Skipping Test.." );
406- return ;
407- }
408- for (int dev = 0 ; dev < devicecount; dev++) {
409- hipDevice_t device;
410- HIP_CHECK (hipDeviceGet (&device, dev));
411- checkVMMSupported (device);
412- hipMemAllocationProp prop{};
413- prop.type = hipMemAllocationTypePinned;
414- prop.location .type = hipMemLocationTypeDevice;
415- prop.location .id = device; // Current Devices
416- HIP_CHECK (
417- hipMemGetAllocationGranularity (&granularity, &prop, hipMemAllocationGranularityMinimum));
418- REQUIRE (granularity > 0 );
419- size_t size_mem = ((granularity + buffer_size - 1 ) / granularity) * granularity;
420- hipMemGenericAllocationHandle_t handle;
421- // Allocate a physical memory chunk
422- HIP_CHECK (hipMemCreate (&handle, size_mem, &prop, 0 ));
423- // Allocate num_buf virtual address ranges
424- hipDeviceptr_t ptrA;
425- HIP_CHECK (hipMemAddressReserve (&ptrA, size_mem, 0 , 0 , 0 ));
426- hipMemAccessDesc accessDesc = {};
427- accessDesc.location .type = hipMemLocationTypeDevice;
428- accessDesc.location .id = device;
429- accessDesc.flags = hipMemAccessFlagsProtReadWrite;
430- HIP_CHECK (hipMemMap (ptrA, size_mem, 0 , handle, 0 ));
431- HIP_CHECK (hipMemSetAccess (ptrA, size_mem, &accessDesc, 1 ));
432- int * vptr = reinterpret_cast <int *>(ptrA);
433- for (int idx = 0 ; idx < N; idx++) {
434- *(vptr + idx) = idx;
435- }
436- // validate
437- for (int idx = 0 ; idx < N; idx++) {
438- REQUIRE (*(vptr + idx) == idx);
439- }
440- HIP_CHECK (hipMemUnmap (ptrA, size_mem));
441- // Release resources
442- HIP_CHECK (hipMemRelease (handle));
443- HIP_CHECK (hipMemAddressFree (ptrA, size_mem));
444- }
445- }
446-
447386/* *
448387 * Test Description
449388 * ------------------------
0 commit comments