mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
feature(ocl) use tags to synchronize multi root device events
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a27834ff7d
commit
fa4830036a
@@ -19,6 +19,7 @@
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/memory_manager/unified_memory_manager.h"
|
||||
#include "shared/source/utilities/heap_allocator.h"
|
||||
#include "shared/source/utilities/tag_allocator.h"
|
||||
|
||||
#include "opencl/source/cl_device/cl_device.h"
|
||||
#include "opencl/source/command_queue/command_queue.h"
|
||||
@@ -49,7 +50,9 @@ Context::Context(
|
||||
|
||||
Context::~Context() {
|
||||
gtpinNotifyContextDestroy((cl_context)this);
|
||||
|
||||
if (multiRootDeviceTimestampPacketAllocator.get() != nullptr) {
|
||||
multiRootDeviceTimestampPacketAllocator.reset();
|
||||
}
|
||||
if (smallBufferPoolAllocator.isAggregatedSmallBuffersEnabled(this)) {
|
||||
smallBufferPoolAllocator.releaseSmallBufferPool();
|
||||
}
|
||||
@@ -564,5 +567,15 @@ void Context::BufferPoolAllocator::releaseSmallBufferPool() {
|
||||
delete this->mainStorage;
|
||||
this->mainStorage = nullptr;
|
||||
}
|
||||
TagAllocatorBase *Context::getMultiRootDeviceTimestampPacketAllocator() {
|
||||
return multiRootDeviceTimestampPacketAllocator.get();
|
||||
}
|
||||
void Context::setMultiRootDeviceTimestampPacketAllocator(std::unique_ptr<TagAllocatorBase> &allocator) {
|
||||
multiRootDeviceTimestampPacketAllocator = std::move(allocator);
|
||||
}
|
||||
|
||||
std::unique_lock<std::mutex> Context::obtainOwnershipForMultiRootDeviceAllocator() {
|
||||
return std::unique_lock<std::mutex>(multiRootDeviceAllocatorMtx);
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user