SWDEV-447525 - maxSize param for Mem pool props.

Change-Id: Ib743611a66921aeaa449b6622b933cc8b9190d87
This commit is contained in:
Jaydeep Patel
2024-02-27 06:43:32 +00:00
کامیت شده توسط Jaydeepkumar Patel
والد f1adecd186
کامیت b72d8da1bd
2فایلهای تغییر یافته به همراه4 افزوده شده و 0 حذف شده
@@ -171,6 +171,9 @@ void* MemoryPool::AllocateMemory(size_t size, Stream* stream, void* dptr) {
void* dev_ptr = nullptr;
amd::Memory* memory = free_heap_.FindMemory(size, stream, Opportunistic(), dptr);
if (memory == nullptr) {
if (Properties().maxSize != 0 && (max_total_size_ + size) > Properties().maxSize) {
return nullptr;
}
amd::Context* context = device_->asContext();
const auto& dev_info = context->devices()[0]->info();
if (dev_info.maxMemAllocSize_ < size) {