Use sysconf pagesize for system pagesize
Provided by user huanggyizhi on github https://github.com/RadeonOpenCompute/ROCR-Runtime/pull/124 Change-Id: Ia03c45f7a869ae2c804accf8163f8ae36c20dd5a
Šī revīzija ir iekļauta:
@@ -193,7 +193,7 @@ class MemoryRegion : public core::MemoryRegion {
|
||||
// fragments of the block routing to the same MemoryRegion.
|
||||
mutable KernelMutex access_lock_;
|
||||
|
||||
static const size_t kPageSize_ = 4096;
|
||||
static size_t kPageSize_;
|
||||
|
||||
// Determine access type allowed to requesting device
|
||||
hsa_amd_memory_pool_access_t GetAccessInfo(const core::Agent& agent,
|
||||
|
||||
@@ -50,12 +50,14 @@
|
||||
#include "core/inc/amd_gpu_agent.h"
|
||||
#include "core/util/utils.h"
|
||||
#include "core/inc/exceptions.h"
|
||||
#include <unistd.h>
|
||||
|
||||
namespace rocr {
|
||||
namespace AMD {
|
||||
|
||||
// Tracks aggregate size of system memory available on platform
|
||||
size_t MemoryRegion::max_sysmem_alloc_size_ = 0;
|
||||
size_t MemoryRegion::kPageSize_ = sysconf(_SC_PAGESIZE);
|
||||
|
||||
void* MemoryRegion::AllocateKfdMemory(const HsaMemFlags& flag,
|
||||
HSAuint32 node_id, size_t size) {
|
||||
@@ -137,7 +139,7 @@ MemoryRegion::MemoryRegion(bool fine_grain, bool kernarg, bool full_profile,
|
||||
virtual_size_ = kGpuVmSize;
|
||||
|
||||
} else if (IsSystem()) {
|
||||
mem_flag_.ui32.PageSize = HSA_PAGE_SIZE_4KB;
|
||||
mem_flag_.ui32.PageSize = MemoryRegion::kPageSize_;
|
||||
mem_flag_.ui32.NoSubstitute = 0;
|
||||
mem_flag_.ui32.HostAccess = 1;
|
||||
mem_flag_.ui32.CachePolicy = HSA_CACHING_CACHED;
|
||||
|
||||
Atsaukties uz šo jaunā problēmā
Block a user