mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 05:52:19 +08:00
Remove getAnyBcs() method
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
78609cd9f5
commit
b8a03cdea1
@@ -89,6 +89,7 @@ CommandQueue::CommandQueue(Context *context, ClDevice *device, const cl_queue_pr
|
||||
auto &selectorCopyEngine = neoDevice.getSelectorCopyEngine();
|
||||
auto bcsEngineType = EngineHelpers::getBcsEngineType(hwInfo, device->getDeviceBitfield(), selectorCopyEngine, internalUsage);
|
||||
bcsEngines[EngineHelpers::getBcsIndex(bcsEngineType)] = neoDevice.tryGetEngine(bcsEngineType, EngineUsage::Regular);
|
||||
bcsEngineTypes.push_back(bcsEngineType);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -142,7 +143,7 @@ CommandStreamReceiver *CommandQueue::getBcsCommandStreamReceiver(aub_stream::Eng
|
||||
}
|
||||
}
|
||||
|
||||
CommandStreamReceiver *CommandQueue::getAnyBcs() const {
|
||||
CommandStreamReceiver *CommandQueue::getBcsForAuxTranslation() const {
|
||||
for (const EngineControl *engine : this->bcsEngines) {
|
||||
if (engine != nullptr) {
|
||||
return engine->commandStreamReceiver;
|
||||
@@ -151,13 +152,9 @@ CommandStreamReceiver *CommandQueue::getAnyBcs() const {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
CommandStreamReceiver *CommandQueue::getBcsForAuxTranslation() const {
|
||||
return getAnyBcs();
|
||||
}
|
||||
|
||||
CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelectionArgs &args) const {
|
||||
if (isCopyOnly) {
|
||||
return *getAnyBcs();
|
||||
return *getBcsCommandStreamReceiver(bcsEngineTypes[0]);
|
||||
}
|
||||
|
||||
if (!blitEnqueueAllowed(args)) {
|
||||
@@ -193,8 +190,8 @@ CommandStreamReceiver &CommandQueue::selectCsrForBuiltinOperation(const CsrSelec
|
||||
CommandStreamReceiver *selectedCsr = nullptr;
|
||||
if (preferBcs) {
|
||||
selectedCsr = getBcsCommandStreamReceiver(preferredBcsEngineType);
|
||||
if (selectedCsr == nullptr) {
|
||||
selectedCsr = getAnyBcs();
|
||||
if (selectedCsr == nullptr && !bcsEngineTypes.empty()) {
|
||||
selectedCsr = getBcsCommandStreamReceiver(bcsEngineTypes[0]);
|
||||
}
|
||||
}
|
||||
if (selectedCsr == nullptr) {
|
||||
@@ -928,6 +925,7 @@ void CommandQueue::overrideEngine(aub_stream::EngineType engineType, EngineUsage
|
||||
if (isEngineCopyOnly) {
|
||||
std::fill(bcsEngines.begin(), bcsEngines.end(), nullptr);
|
||||
bcsEngines[EngineHelpers::getBcsIndex(engineType)] = &device->getEngine(engineType, EngineUsage::Regular);
|
||||
bcsEngineTypes = {engineType};
|
||||
timestampPacketContainer = std::make_unique<TimestampPacketContainer>();
|
||||
deferredTimestampPackets = std::make_unique<TimestampPacketContainer>();
|
||||
isCopyOnly = true;
|
||||
|
||||
@@ -232,7 +232,6 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &getGpgpuCommandStreamReceiver() const;
|
||||
CommandStreamReceiver *getBcsCommandStreamReceiver(aub_stream::EngineType bcsEngineType) const;
|
||||
CommandStreamReceiver *getAnyBcs() const;
|
||||
CommandStreamReceiver *getBcsForAuxTranslation() const;
|
||||
MOCKABLE_VIRTUAL CommandStreamReceiver &selectCsrForBuiltinOperation(const CsrSelectionArgs &args) const;
|
||||
Device &getDevice() const noexcept;
|
||||
@@ -374,6 +373,7 @@ class CommandQueue : public BaseObject<_cl_command_queue> {
|
||||
ClDevice *device = nullptr;
|
||||
EngineControl *gpgpuEngine = nullptr;
|
||||
std::array<EngineControl *, bcsInfoMaskSize> bcsEngines = {};
|
||||
std::vector<aub_stream::EngineType> bcsEngineTypes = {};
|
||||
|
||||
cl_command_queue_properties commandQueueProperties = 0;
|
||||
std::vector<uint64_t> propertiesVector;
|
||||
|
||||
@@ -207,7 +207,7 @@ HWTEST_F(EnqueueHandlerTest, givenBlitPropertyWhenEnqueueIsBlockedThenRegisterBl
|
||||
Surface *surfaces[] = {nullptr};
|
||||
mockCmdQ->enqueueBlocked(CL_COMMAND_READ_BUFFER, surfaces, size_t(0), multiDispatchInfo, timestampPacketDependencies,
|
||||
blockedCommandsData, enqueuePropertiesForBlitEnqueue, eventsRequest,
|
||||
eventBuilder, std::unique_ptr<PrintfHandler>(nullptr), mockCmdQ->getAnyBcs());
|
||||
eventBuilder, std::unique_ptr<PrintfHandler>(nullptr), mockCmdQ->getBcsForAuxTranslation());
|
||||
EXPECT_TRUE(blockedCommandsDataForBlitEnqueue->blitEnqueue);
|
||||
EXPECT_EQ(blitProperties.srcAllocation, blockedCommandsDataForBlitEnqueue->blitPropertiesContainer.begin()->srcAllocation);
|
||||
EXPECT_EQ(blitProperties.dstAllocation, blockedCommandsDataForBlitEnqueue->blitPropertiesContainer.begin()->dstAllocation);
|
||||
|
||||
@@ -19,6 +19,7 @@ namespace NEO {
|
||||
class MockCommandQueue : public CommandQueue {
|
||||
public:
|
||||
using CommandQueue::bcsEngines;
|
||||
using CommandQueue::bcsEngineTypes;
|
||||
using CommandQueue::blitEnqueueAllowed;
|
||||
using CommandQueue::blitEnqueueImageAllowed;
|
||||
using CommandQueue::bufferCpuCopyAllowed;
|
||||
@@ -37,12 +38,14 @@ class MockCommandQueue : public CommandQueue {
|
||||
|
||||
void clearBcsEngines() {
|
||||
std::fill(bcsEngines.begin(), bcsEngines.end(), nullptr);
|
||||
bcsEngineTypes.clear();
|
||||
}
|
||||
|
||||
void insertBcsEngine(aub_stream::EngineType bcsEngineType) {
|
||||
const auto index = NEO::EngineHelpers::getBcsIndex(bcsEngineType);
|
||||
const auto engine = &getDevice().getEngine(bcsEngineType, EngineUsage::Regular);
|
||||
bcsEngines[index] = engine;
|
||||
bcsEngineTypes.push_back(bcsEngineType);
|
||||
}
|
||||
|
||||
size_t countBcsEngines() const {
|
||||
|
||||
Reference in New Issue
Block a user