mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-30 01:35:20 +08:00
feature: initial support for counter based event flags
Related-To: NEO-8145 Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ea22536369
commit
f530cf3cc2
@@ -46,6 +46,11 @@ ze_result_t EventPool::initialize(DriverHandle *driver, Context *context, uint32
|
||||
return ZE_RESULT_ERROR_UNSUPPORTED_FEATURE;
|
||||
}
|
||||
|
||||
constexpr uint32_t supportedCounterBasedFlags = ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_IMMEDIATE | ZE_EVENT_POOL_COUNTER_BASED_EXP_FLAG_NON_IMMEDIATE;
|
||||
if (counterBased && ((counterBasedFlags & supportedCounterBasedFlags) == 0)) {
|
||||
return ZE_RESULT_ERROR_INVALID_ARGUMENT;
|
||||
}
|
||||
|
||||
RootDeviceIndicesContainer rootDeviceIndices;
|
||||
uint32_t maxRootDeviceIndex = 0u;
|
||||
uint32_t currentNumDevices = numDevices;
|
||||
@@ -210,6 +215,8 @@ void EventPool::setupDescriptorFlags(const ze_event_pool_desc_t *desc) {
|
||||
auto pNext = reinterpret_cast<const ze_base_desc_t *>(desc->pNext);
|
||||
|
||||
if (pNext && pNext->stype == ZE_STRUCTURE_TYPE_COUNTER_BASED_EVENT_POOL_EXP_DESC) {
|
||||
auto counterBasedDesc = reinterpret_cast<const ze_event_pool_counter_based_exp_desc_t *>(pNext);
|
||||
counterBasedFlags = counterBasedDesc->flags;
|
||||
counterBased = true;
|
||||
}
|
||||
}
|
||||
@@ -354,9 +361,10 @@ ze_result_t Event::destroy() {
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
void Event::enableCounterBasedMode(bool apiRequest) {
|
||||
void Event::enableCounterBasedMode(bool apiRequest, uint32_t flags) {
|
||||
if (counterBasedMode == CounterBasedMode::initiallyDisabled) {
|
||||
counterBasedMode = apiRequest ? CounterBasedMode::explicitlyEnabled : CounterBasedMode::implicitlyEnabled;
|
||||
counterBasedFlags = flags;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,6 +375,7 @@ void Event::disableImplicitCounterBasedMode() {
|
||||
|
||||
if (counterBasedMode == CounterBasedMode::implicitlyEnabled || counterBasedMode == CounterBasedMode::initiallyDisabled) {
|
||||
counterBasedMode = CounterBasedMode::implicitlyDisabled;
|
||||
counterBasedFlags = 0;
|
||||
unsetInOrderExecInfo();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user