SWDEV-460242 - Add system memory suballocator

Switch commands creation to the new suballocator to avoid
frequent expensive OS calls

Change-Id: I3597c811820e577c15708bad8b8a41aa53acc400


[ROCm/clr commit: 5b0bfdcbad]
Этот коммит содержится в:
German Andryeyev
2024-05-03 17:06:10 -04:00
коммит произвёл Maneesh Gupta
родитель 3ca0dbc4d7
Коммит 68344576d3
3 изменённых файлов: 130 добавлений и 18 удалений
+13 -9
Просмотреть файл
@@ -1,4 +1,4 @@
/* Copyright (c) 2008 - 2021 Advanced Micro Devices, Inc.
/* Copyright (c) 2008 - 2024 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
@@ -18,14 +18,6 @@
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE. */
/*!
* \file command.cpp
* \brief Definitions for Event, Command and HostQueue objects.
*
* \author Laurent Morichetti
* \date October 2008
*/
#include "platform/activity.hpp"
#include "platform/command.hpp"
#include "platform/commandqueue.hpp"
@@ -326,6 +318,18 @@ Command::Command(HostQueue& queue, cl_command_type type, const EventWaitList& ev
}
}
SysmemPool<ComputeCommand> Command::command_pool_;
// ================================================================================================
void Command::operator delete(void* ptr) {
command_pool_.Free(ptr);
}
// ================================================================================================
void* Command::operator new(size_t size) {
return command_pool_.Alloc(size);
}
// ================================================================================================
void Command::releaseResources() {
const Command::EventWaitList& events = eventWaitList();