Workaround: make mmap memory resident for gfx902

Change-Id: I5f90f316740f7995d54cb083a6d7e05bc4e2966e
Signed-off-by: Yong Zhao <yong.zhao@amd.com>


[ROCm/ROCR-Runtime commit: 716755b1de]
This commit is contained in:
Yong Zhao
2017-11-29 11:48:10 -05:00
parent 738a69caeb
commit cbcae4eecc
2 changed files with 7 additions and 0 deletions
+4
View File
@@ -933,6 +933,8 @@ void *fmm_allocate_scratch(uint32_t gpu_id, uint64_t MemorySizeInBytes)
munmap(aligned_end,
VOID_PTRS_SUB(padded_end, aligned_end));
mem = aligned_start;
memset(mem, 0, aligned_size);
}
/* Remember scratch backing aperture for later */
@@ -1131,6 +1133,8 @@ static void *fmm_allocate_host_cpu(uint64_t MemorySizeInBytes,
if (mem == MAP_FAILED)
return NULL;
memset(mem, 0, MemorySizeInBytes);
pthread_mutex_lock(&cpuvm_aperture.fmm_mutex);
vm_obj = aperture_allocate_object(&cpuvm_aperture, mem, 0,
MemorySizeInBytes, flags.Value);
+3
View File
@@ -323,6 +323,9 @@ static void *allocate_exec_aligned_memory_cpu(uint32_t size)
if (ptr == MAP_FAILED)
return NULL;
memset(ptr, 0, size);
return ptr;
}