Create fine-grained allocator
Create allocator helper function to provide fine-grained memory on a specific agent. Change-Id: I32ba9aceb9c9dc708b140a0c45158e6e7a018844
Este cometimento está contido em:
@@ -411,6 +411,13 @@ class GpuAgent : public GpuAgentInt {
|
||||
|
||||
const std::function<void(void*)>& system_deallocator() const { return system_deallocator_; }
|
||||
|
||||
const std::function<void*(size_t size, core::MemoryRegion::AllocateFlags flags)>&
|
||||
finegrain_allocator() const {
|
||||
return finegrain_allocator_;
|
||||
}
|
||||
|
||||
const std::function<void(void*)>& finegrain_deallocator() const { return finegrain_deallocator_; }
|
||||
|
||||
protected:
|
||||
// Sizes are in packets.
|
||||
static const uint32_t minAqlSize_ = 0x40; // 4KB min
|
||||
@@ -581,8 +588,8 @@ class GpuAgent : public GpuAgentInt {
|
||||
// @brief Setup GWS accessing queue.
|
||||
void InitGWS();
|
||||
|
||||
// @brief Setup NUMA aware system memory allocator.
|
||||
void InitNumaAllocator();
|
||||
// @brief Set-up memory allocators
|
||||
void InitAllocators();
|
||||
|
||||
// @brief Initialize scratch handler thresholds
|
||||
void InitAsyncScratchThresholds();
|
||||
@@ -657,6 +664,10 @@ class GpuAgent : public GpuAgentInt {
|
||||
|
||||
std::function<void(void*)> system_deallocator_;
|
||||
|
||||
// Fine grain allocator on this device
|
||||
std::function<void*(size_t size, core::MemoryRegion::AllocateFlags flags)> finegrain_allocator_;
|
||||
|
||||
std::function<void(void*)> finegrain_deallocator_;
|
||||
// @brief device handle
|
||||
amdgpu_device_handle ldrm_dev_;
|
||||
|
||||
|
||||
@@ -96,7 +96,7 @@ class MemoryRegion : public core::MemoryRegion {
|
||||
static void MakeKfdMemoryUnresident(const void* ptr);
|
||||
|
||||
MemoryRegion(bool fine_grain, bool kernarg, bool full_profile, bool extended_scope_fine_grain,
|
||||
core::Agent* owner, const HsaMemoryProperties& mem_props);
|
||||
bool user_visible, core::Agent* owner, const HsaMemoryProperties& mem_props);
|
||||
|
||||
~MemoryRegion();
|
||||
|
||||
|
||||
@@ -58,11 +58,12 @@ class Agent;
|
||||
class MemoryRegion : public Checked<0x9C961F19EE175BB3> {
|
||||
public:
|
||||
MemoryRegion(bool fine_grain, bool kernarg, bool full_profile, bool extended_scope_fine_grain,
|
||||
core::Agent* owner)
|
||||
bool user_visible, core::Agent* owner)
|
||||
: fine_grain_(fine_grain),
|
||||
kernarg_(kernarg),
|
||||
full_profile_(full_profile),
|
||||
extended_scope_fine_grain_(extended_scope_fine_grain),
|
||||
user_visible_(user_visible),
|
||||
owner_(owner) {
|
||||
assert(owner_ != NULL);
|
||||
}
|
||||
@@ -132,6 +133,8 @@ class MemoryRegion : public Checked<0x9C961F19EE175BB3> {
|
||||
|
||||
__forceinline bool full_profile() const { return full_profile_; }
|
||||
|
||||
__forceinline bool user_visible() const { return user_visible_; }
|
||||
|
||||
__forceinline core::Agent* owner() const { return owner_; }
|
||||
|
||||
private:
|
||||
@@ -139,6 +142,8 @@ class MemoryRegion : public Checked<0x9C961F19EE175BB3> {
|
||||
const bool kernarg_;
|
||||
const bool full_profile_;
|
||||
const bool extended_scope_fine_grain_;
|
||||
const bool user_visible_;
|
||||
|
||||
core::Agent* owner_;
|
||||
};
|
||||
} // namespace core
|
||||
|
||||
Criar uma nova questão referindo esta
Bloquear um utilizador