rocr: Expose flag to allocate uncached memory (#674)

Add new flag for clients to directly request uncached memory
Этот коммит содержится в:
David Yat Sin
2025-08-22 09:52:39 -04:00
коммит произвёл GitHub
родитель 5eb4ff1ca7
Коммит a1597a358a
3 изменённых файлов: 13 добавлений и 1 удалений
+6
Просмотреть файл
@@ -241,6 +241,12 @@ KfdDriver::AllocateMemory(const core::MemoryRegion &mem_region,
? 1
: kmt_alloc_flags.ui32.Uncached);
if (kmt_alloc_flags.ui32.Uncached) {
/* Uncached overwrites CoarseGrain and ExtendedCoherent */
kmt_alloc_flags.ui32.CoarseGrain = 0;
kmt_alloc_flags.ui32.ExtendedCoherent = 0;
}
kmt_alloc_flags.ui32.ExecuteBlit =
!!(alloc_flags & core::MemoryRegion::AllocateExecutableBlitKernelObject);
+3
Просмотреть файл
@@ -881,6 +881,9 @@ hsa_status_t hsa_amd_memory_pool_allocate(hsa_amd_memory_pool_t memory_pool, siz
if (flags & HSA_AMD_MEMORY_POOL_EXECUTABLE_FLAG)
alloc_flag |= core::MemoryRegion::AllocateExecutable;
if (flags & HSA_AMD_MEMORY_POOL_UNCACHED_FLAG)
alloc_flag |= core::MemoryRegion::AllocateUncached;
#ifdef SANITIZER_AMDGPU
if (mem_region->owner()->device_type() == core::Agent::kAmdGpuDevice)
alloc_flag |= core::MemoryRegion::AllocateAsan;
+4 -1
Просмотреть файл
@@ -1579,7 +1579,10 @@ typedef enum hsa_amd_memory_pool_flag_s {
* Allocates executable memory
*/
HSA_AMD_MEMORY_POOL_EXECUTABLE_FLAG = (1 << 2),
/**
* Allocates uncached memory
*/
HSA_AMD_MEMORY_POOL_UNCACHED_FLAG = (1 << 3),
} hsa_amd_memory_pool_flag_t;
/**