mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-06 02:18:05 +08:00
feature: disable implicit counter based Events transition in IPC mode
Related-To: NEO-8145 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ac8c00048e
commit
c281b66587
@@ -42,9 +42,7 @@ template Event *Event::create<uint32_t>(EventPool *, const ze_event_desc_t *, De
|
||||
ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32_t numDevices, ze_device_handle_t *deviceHandles) {
|
||||
this->context = static_cast<ContextImp *>(context);
|
||||
|
||||
bool ipcPool = eventPoolFlags & ZE_EVENT_POOL_FLAG_IPC;
|
||||
|
||||
if (ipcPool && counterBased) {
|
||||
if (isIpcPoolFlagSet() && counterBased) {
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
@@ -114,7 +112,7 @@ ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32
|
||||
if (graphicsAllocation) {
|
||||
eventPoolAllocations->addAllocation(graphicsAllocation);
|
||||
allocatedMemory = true;
|
||||
if (ipcPool) {
|
||||
if (isIpcPoolFlagSet()) {
|
||||
uint64_t handle = 0;
|
||||
this->isShareableEventMemory = (graphicsAllocation->peekInternalHandle(memoryManager, handle) == 0);
|
||||
}
|
||||
@@ -127,7 +125,7 @@ ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32
|
||||
eventPoolPtr = driver->getMemoryManager()->createMultiGraphicsAllocationInSystemMemoryPool(rootDeviceIndices,
|
||||
allocationProperties,
|
||||
*eventPoolAllocations);
|
||||
if (ipcPool) {
|
||||
if (isIpcPoolFlagSet()) {
|
||||
this->isShareableEventMemory = eventPoolAllocations->getDefaultGraphicsAllocation()->isShareableHostMemory;
|
||||
}
|
||||
allocatedMemory = (nullptr != eventPoolPtr);
|
||||
@@ -207,6 +205,8 @@ void EventPool::setupDescriptorFlags(const ze_event_pool_desc_t *desc) {
|
||||
eventPoolFlags |= ZE_EVENT_POOL_FLAG_KERNEL_TIMESTAMP;
|
||||
}
|
||||
|
||||
this->isIpcPoolFlag = !!(eventPoolFlags & ZE_EVENT_POOL_FLAG_IPC);
|
||||
|
||||
auto pNext = reinterpret_cast<const ze_base_desc_t *>(desc->pNext);
|
||||
|
||||
if (pNext && pNext->stype == ZE_STRUCTURE_TYPE_COUNTER_BASED_EVENT_POOL_EXP_DESC) {
|
||||
|
||||
@@ -365,6 +365,7 @@ struct EventPool : _ze_event_pool_handle_t {
|
||||
}
|
||||
|
||||
bool isCounterBased() const { return counterBased; }
|
||||
bool isIpcPoolFlagSet() const { return isIpcPoolFlag; }
|
||||
|
||||
protected:
|
||||
EventPool() = default;
|
||||
@@ -390,6 +391,7 @@ struct EventPool : _ze_event_pool_handle_t {
|
||||
bool isDeviceEventPoolAllocation = false;
|
||||
bool isHostVisibleEventPoolAllocation = false;
|
||||
bool isImportedIpcPool = false;
|
||||
bool isIpcPoolFlag = false;
|
||||
bool isShareableEventMemory = false;
|
||||
bool isImplicitScalingCapable = false;
|
||||
bool counterBased = false;
|
||||
|
||||
@@ -50,6 +50,9 @@ Event *Event::create(EventPool *eventPool, const ze_event_desc_t *desc, Device *
|
||||
event->maxKernelCount = eventPool->getMaxKernelCount();
|
||||
event->maxPacketCount = eventPool->getEventMaxPackets();
|
||||
event->isFromIpcPool = eventPool->getImportedIpcPool();
|
||||
if (event->isFromIpcPool || eventPool->isIpcPoolFlagSet()) {
|
||||
event->disableImplicitCounterBasedMode();
|
||||
}
|
||||
|
||||
event->kernelEventCompletionData =
|
||||
std::make_unique<KernelEventCompletionData<TagSizeT>[]>(event->maxKernelCount);
|
||||
|
||||
Reference in New Issue
Block a user