Move isRelaxedOrderingDispatchAllowed to common helper

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-03-09 13:22:23 +00:00
committed by Compute-Runtime-Automation
parent 37768a15d3
commit d7aba6747c
9 changed files with 80 additions and 66 deletions

View File

@@ -1,5 +1,5 @@
#
# Copyright (C) 2020-2022 Intel Corporation
# Copyright (C) 2020-2023 Intel Corporation
#
# SPDX-License-Identifier: MIT
#
@@ -17,6 +17,7 @@ set(NEO_CORE_DIRECT_SUBMISSION
${CMAKE_CURRENT_SOURCE_DIR}/direct_submission_hw_diagnostic_mode.cpp
${CMAKE_CURRENT_SOURCE_DIR}/direct_submission_hw_diagnostic_mode.h
${CMAKE_CURRENT_SOURCE_DIR}/direct_submission_properties.h
${CMAKE_CURRENT_SOURCE_DIR}/relaxed_ordering_helper.cpp
${CMAKE_CURRENT_SOURCE_DIR}/relaxed_ordering_helper.h
)

View File

@@ -0,0 +1,30 @@
/*
* Copyright (C) 2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "shared/source/direct_submission/relaxed_ordering_helper.h"
#include "shared/source/command_stream/command_stream_receiver.h"
#include "shared/source/debug_settings/debug_settings_manager.h"
namespace NEO {
namespace RelaxedOrderingHelper {
bool isRelaxedOrderingDispatchAllowed(const CommandStreamReceiver &csr, uint32_t numWaitEvents) {
if (numWaitEvents == 0u) {
return false;
}
uint32_t minimalNumberOfClients = 2;
if (DebugManager.flags.DirectSubmissionRelaxedOrderingMinNumberOfClients.get() != -1) {
minimalNumberOfClients = static_cast<uint32_t>(DebugManager.flags.DirectSubmissionRelaxedOrderingMinNumberOfClients.get());
}
return (csr.getNumClients() >= minimalNumberOfClients && csr.directSubmissionRelaxedOrderingEnabled());
}
} // namespace RelaxedOrderingHelper
} // namespace NEO

View File

@@ -11,7 +11,10 @@
#include "shared/source/command_container/encode_alu_helper.h"
namespace NEO {
class CommandStreamReceiver;
namespace RelaxedOrderingHelper {
bool isRelaxedOrderingDispatchAllowed(const CommandStreamReceiver &csr, uint32_t numWaitEvents);
static constexpr uint32_t queueSizeMultiplier = 4;