SWDEV-307185 - Create heap for device memory allocator
Pass the allocated heap with the kernel arguments
Change-Id: Icdec09b7f937845c39e21cbca7071dc3ba791af9
[ROCm/clr commit: 7b114a2b8b]
Cette révision appartient à :
@@ -1,4 +1,4 @@
|
||||
/* Copyright (c) 2008 - 2021 Advanced Micro Devices, Inc.
|
||||
/* Copyright (c) 2008 - 2022 Advanced Micro Devices, Inc.
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
@@ -458,6 +458,7 @@ Device::Device()
|
||||
blitProgram_(nullptr),
|
||||
hwDebugMgr_(nullptr),
|
||||
context_(nullptr),
|
||||
heap_buffer_(nullptr),
|
||||
arena_mem_obj_(nullptr),
|
||||
vaCacheAccess_(nullptr),
|
||||
vaCacheMap_(nullptr),
|
||||
@@ -471,6 +472,11 @@ Device::~Device() {
|
||||
delete vaCacheMap_;
|
||||
}
|
||||
|
||||
if (heap_buffer_ != nullptr) {
|
||||
delete heap_buffer_;
|
||||
heap_buffer_ = nullptr;
|
||||
}
|
||||
|
||||
delete vaCacheAccess_;
|
||||
|
||||
if (arena_mem_obj_ != nullptr) {
|
||||
@@ -517,6 +523,11 @@ bool Device::create(const Isa &isa) {
|
||||
if (nullptr == vaCacheMap_) {
|
||||
return false;
|
||||
}
|
||||
if (amd::IS_HIP) {
|
||||
// Allocate initial heap for device memory allocator
|
||||
static constexpr size_t HeapBufferSize = 1024 * Ki;
|
||||
heap_buffer_ = createMemory(HeapBufferSize);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
Référencer dans un nouveau ticket
Bloquer un utilisateur