SWDEV-563752 - Allow hipMemLocationTypeHost in hipMemSetAccess even if memory was created on the device (#1620)

Co-authored-by: Rahul Manocha <rmanocha@amd.com>
Этот коммит содержится в:
Ioannis AssiourasиRahul Manocha authored and GitHub committed 2025-10-31 13:57:36 +00:00
1 родитель 24cb8c4deb
Коммит 1dd0237cb2
2 files changed
+8 -7

No files matched your search

+8 -3
Просмотреть файл
@@ -1489,18 +1489,23 @@ TEST_CASE("Unit_hipMemSetAccessHost_devicealloc") {
HIP_CHECK(hipMemMap(addr, mapSize, 0 /*offset*/, handle, 0 /*flags*/));
// Grant HOST access.
// Grant HOST access.
hipMemAccessDesc accHost{};
accHost.flags = hipMemAccessFlagsProtReadWrite;
accHost.location.type = hipMemLocationTypeHost;
accHost.location.id = 0;
HIP_CHECK_ERROR(hipMemSetAccess(addr, mapSize, &accHost, 1), hipErrorInvalidValue);
#if HT_AMD
// SWDEV-563752: we need to allow setAccess to the host even if location is set to
// hipMemLocationTypeDevice in hipMemCreate
HIP_CHECK(hipMemSetAccess(addr, mapSize, &accHost, 1));
#else
HIP_CHECK_ERROR(hipMemSetAccess(addr, mapSize, &accHost, 1), hipErrorNotSupported);
#endif
HIP_CHECK(hipMemUnmap(addr, mapSize));
HIP_CHECK(hipMemAddressFree(addr, mapSize));
HIP_CHECK(hipMemRelease(handle));
}
/**
* End doxygen group VirtualMemoryManagementTest.
* @}