mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 05:24:02 +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
fecb52ac49
commit
16bc84e27d
@@ -49,7 +49,9 @@ Context::Context(
|
||||
|
||||
Context::~Context() {
|
||||
gtpinNotifyContextDestroy((cl_context)this);
|
||||
|
||||
if (multiRootDeviceTimestampPacketAllocator.get() != nullptr) {
|
||||
multiRootDeviceTimestampPacketAllocator.reset();
|
||||
}
|
||||
if (smallBufferPoolAllocator.isAggregatedSmallBuffersEnabled(this)) {
|
||||
smallBufferPoolAllocator.releaseSmallBufferPool();
|
||||
}
|
||||
@@ -558,5 +560,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
|
||||
|
||||
@@ -37,6 +37,7 @@ class SharingFunctions;
|
||||
class SVMAllocsManager;
|
||||
class Program;
|
||||
class Platform;
|
||||
class TagAllocatorBase;
|
||||
|
||||
template <>
|
||||
struct OpenCLObjectMapper<_cl_context> {
|
||||
@@ -223,6 +224,9 @@ class Context : public BaseObject<_cl_context> {
|
||||
BufferPoolAllocator &getBufferPoolAllocator() {
|
||||
return this->smallBufferPoolAllocator;
|
||||
}
|
||||
TagAllocatorBase *getMultiRootDeviceTimestampPacketAllocator();
|
||||
std::unique_lock<std::mutex> obtainOwnershipForMultiRootDeviceAllocator();
|
||||
void setMultiRootDeviceTimestampPacketAllocator(std::unique_ptr<TagAllocatorBase> &allocator);
|
||||
|
||||
protected:
|
||||
struct BuiltInKernel {
|
||||
@@ -263,6 +267,8 @@ class Context : public BaseObject<_cl_context> {
|
||||
uint32_t maxRootDeviceIndex = std::numeric_limits<uint32_t>::max();
|
||||
cl_bool preferD3dSharedResources = 0u;
|
||||
ContextType contextType = ContextType::CONTEXT_TYPE_DEFAULT;
|
||||
std::unique_ptr<TagAllocatorBase> multiRootDeviceTimestampPacketAllocator;
|
||||
std::mutex multiRootDeviceAllocatorMtx;
|
||||
|
||||
bool interopUserSync = false;
|
||||
bool resolvesRequiredInKernels = false;
|
||||
|
||||
Reference in New Issue
Block a user