mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
fix: choose proper csr for low priority immediate command lists
Resolves: NEO-10168 Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b4d2170a6d
commit
473b892132
@@ -303,7 +303,7 @@ ze_result_t DeviceImp::createCommandQueue(const ze_command_queue_desc_t *desc,
|
||||
bool isCopyOnly = NEO::EngineHelper::isCopyOnlyEngineType(
|
||||
getEngineGroupTypeForOrdinal(commandQueueDesc.ordinal));
|
||||
|
||||
if (commandQueueDesc.priority == ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW && !isCopyOnly) {
|
||||
if (isSuitableForLowPriority(commandQueueDesc.priority, isCopyOnly)) {
|
||||
getCsrForLowPriority(&csr);
|
||||
} else {
|
||||
auto ret = getCsrForOrdinalAndIndexWithPriority(&csr, commandQueueDesc.ordinal, commandQueueDesc.index, commandQueueDesc.priority);
|
||||
@@ -1676,6 +1676,9 @@ ze_result_t DeviceImp::getCsrForOrdinalAndIndexWithPriority(NEO::CommandStreamRe
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (isSuitableForLowPriority(priority, NEO::EngineHelper::isCopyOnlyEngineType(
|
||||
getEngineGroupTypeForOrdinal(ordinal)))) {
|
||||
return getCsrForLowPriority(csr);
|
||||
}
|
||||
|
||||
return getCsrForOrdinalAndIndex(csr, ordinal, index);
|
||||
@@ -1700,6 +1703,10 @@ ze_result_t DeviceImp::getCsrForLowPriority(NEO::CommandStreamReceiver **csr) {
|
||||
return ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
bool DeviceImp::isSuitableForLowPriority(ze_command_queue_priority_t priority, bool copyOnly) {
|
||||
return (priority == ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW && !copyOnly);
|
||||
}
|
||||
|
||||
DebugSession *DeviceImp::getDebugSession(const zet_debug_config_t &config) {
|
||||
return debugSession.get();
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2020-2023 Intel Corporation
|
||||
* Copyright (C) 2020-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -114,6 +114,7 @@ struct DeviceImp : public Device, NEO::NonCopyableOrMovableClass {
|
||||
ze_result_t getCsrForOrdinalAndIndex(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index) override;
|
||||
ze_result_t getCsrForOrdinalAndIndexWithPriority(NEO::CommandStreamReceiver **csr, uint32_t ordinal, uint32_t index, ze_command_queue_priority_t priority) override;
|
||||
ze_result_t getCsrForLowPriority(NEO::CommandStreamReceiver **csr) override;
|
||||
bool isSuitableForLowPriority(ze_command_queue_priority_t priority, bool copyOnly);
|
||||
NEO::GraphicsAllocation *obtainReusableAllocation(size_t requiredSize, NEO::AllocationType type) override;
|
||||
void storeReusableAllocation(NEO::GraphicsAllocation &alloc) override;
|
||||
NEO::Device *getActiveDevice() const;
|
||||
|
||||
Reference in New Issue
Block a user