mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-18 13:54:58 +08:00
refactor: Add dedicated method to check if any ULLS light enabled
Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
e3e01e94a0
commit
0a11a96a53
@@ -1058,7 +1058,7 @@ ze_result_t CommandListCoreFamily<gfxCoreFamily>::appendImageCopyToMemoryExt(voi
|
||||
return ZE_RESULT_ERROR_UNKNOWN;
|
||||
}
|
||||
|
||||
if (this->device->getNEODevice()->isAnyDirectSubmissionEnabled(false)) {
|
||||
if (this->device->getNEODevice()->isAnyDirectSubmissionEnabled()) {
|
||||
NEO::PipeControlArgs pipeControlArgs;
|
||||
pipeControlArgs.textureCacheInvalidationEnable = true;
|
||||
NEO::MemorySynchronizationCommands<GfxFamily>::addSingleBarrier(*commandContainer.getCommandStream(), pipeControlArgs);
|
||||
@@ -4097,7 +4097,7 @@ void CommandListCoreFamily<gfxCoreFamily>::dispatchPostSyncCommands(const CmdLis
|
||||
if (isImmediateType()) {
|
||||
pipeControlArgs.constantCacheInvalidationEnable = getCsr(false)->isDirectSubmissionEnabled();
|
||||
} else {
|
||||
pipeControlArgs.constantCacheInvalidationEnable = this->device->getNEODevice()->isAnyDirectSubmissionEnabled(false);
|
||||
pipeControlArgs.constantCacheInvalidationEnable = this->device->getNEODevice()->isAnyDirectSubmissionEnabled();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -733,7 +733,7 @@ HWTEST2_F(CommandListAppendUsedPacketSignalEvent,
|
||||
EXPECT_TRUE(cmd->getCommandStreamerStallEnable());
|
||||
EXPECT_EQ(gpuAddress, NEO::UnitTestHelper<FamilyType>::getPipeControlPostSyncAddress(*cmd));
|
||||
EXPECT_EQ(MemorySynchronizationCommands<FamilyType>::getDcFlushEnable(true, device->getNEODevice()->getRootDeviceEnvironment()), cmd->getDcFlushEnable());
|
||||
EXPECT_EQ(device->getNEODevice()->isAnyDirectSubmissionEnabled(false), cmd->getConstantCacheInvalidationEnable());
|
||||
EXPECT_EQ(device->getNEODevice()->isAnyDirectSubmissionEnabled(), cmd->getConstantCacheInvalidationEnable());
|
||||
EXPECT_TRUE(cmd->getWorkloadPartitionIdOffsetEnable());
|
||||
postSyncFound++;
|
||||
gpuAddress += event->getSinglePacketSize();
|
||||
|
||||
@@ -107,7 +107,7 @@ CommandQueue::CommandQueue(Context *context, ClDevice *device, const cl_queue_pr
|
||||
auto &compilerProductHelper = device->getCompilerProductHelper();
|
||||
auto &rootDeviceEnvironment = device->getRootDeviceEnvironment();
|
||||
|
||||
bcsAllowed = !device->getDevice().isAnyDirectSubmissionEnabled(true) &&
|
||||
bcsAllowed = !device->getDevice().isAnyDirectSubmissionLightEnabled() &&
|
||||
productHelper.isBlitterFullySupported(hwInfo) &&
|
||||
gfxCoreHelper.isSubDeviceEngineSupported(rootDeviceEnvironment, device->getDeviceBitfield(), aub_stream::EngineType::ENGINE_BCS);
|
||||
|
||||
|
||||
@@ -1095,7 +1095,15 @@ void Device::stopDirectSubmissionAndWaitForCompletion() {
|
||||
}
|
||||
}
|
||||
|
||||
bool Device::isAnyDirectSubmissionEnabled(bool light) const {
|
||||
bool Device::isAnyDirectSubmissionEnabled() const {
|
||||
return this->isAnyDirectSubmissionEnabledImpl(false);
|
||||
}
|
||||
|
||||
bool Device::isAnyDirectSubmissionLightEnabled() const {
|
||||
return this->isAnyDirectSubmissionEnabledImpl(true);
|
||||
}
|
||||
|
||||
bool Device::isAnyDirectSubmissionEnabledImpl(bool light) const {
|
||||
for (const auto &engine : allEngines) {
|
||||
auto enabled = light ? engine.osContext->isDirectSubmissionLightActive() : engine.commandStreamReceiver->isAnyDirectSubmissionEnabled();
|
||||
if (enabled) {
|
||||
|
||||
@@ -205,7 +205,8 @@ class Device : public ReferenceTrackedObject<Device>, NEO::NonCopyableAndNonMova
|
||||
return deviceUsmMemAllocPoolsManager.get();
|
||||
}
|
||||
MOCKABLE_VIRTUAL void stopDirectSubmissionAndWaitForCompletion();
|
||||
MOCKABLE_VIRTUAL bool isAnyDirectSubmissionEnabled(bool light) const;
|
||||
bool isAnyDirectSubmissionEnabled() const;
|
||||
bool isAnyDirectSubmissionLightEnabled() const;
|
||||
bool isStateSipRequired() const {
|
||||
return (getPreemptionMode() == PreemptionMode::MidThread || getDebugger() != nullptr) && getCompilerInterface();
|
||||
}
|
||||
@@ -278,6 +279,7 @@ class Device : public ReferenceTrackedObject<Device>, NEO::NonCopyableAndNonMova
|
||||
MOCKABLE_VIRTUAL std::unique_ptr<CommandStreamReceiver> createCommandStreamReceiver() const;
|
||||
MOCKABLE_VIRTUAL SubDevice *createSubDevice(uint32_t subDeviceIndex);
|
||||
MOCKABLE_VIRTUAL size_t getMaxParameterSizeFromIGC() const;
|
||||
MOCKABLE_VIRTUAL bool isAnyDirectSubmissionEnabledImpl(bool light) const;
|
||||
double getPercentOfGlobalMemoryAvailable() const;
|
||||
virtual void createBindlessHeapsHelper() {}
|
||||
bool createSubDevices();
|
||||
|
||||
@@ -936,7 +936,7 @@ void SVMAllocsManager::initUsmAllocationsCaches(Device &device) {
|
||||
usmDeviceAllocationsCacheEnabled = !!debugManager.flags.ExperimentalEnableDeviceAllocationCache.get();
|
||||
}
|
||||
if (usmDeviceAllocationsCacheEnabled) {
|
||||
device.getExecutionEnvironment()->initializeUnifiedMemoryReuseCleaner(!device.isAnyDirectSubmissionEnabled(true));
|
||||
device.getExecutionEnvironment()->initializeUnifiedMemoryReuseCleaner(!device.isAnyDirectSubmissionLightEnabled());
|
||||
this->initUsmDeviceAllocationsCache(device);
|
||||
}
|
||||
|
||||
@@ -945,7 +945,7 @@ void SVMAllocsManager::initUsmAllocationsCaches(Device &device) {
|
||||
usmHostAllocationsCacheEnabled = !!debugManager.flags.ExperimentalEnableHostAllocationCache.get();
|
||||
}
|
||||
if (usmHostAllocationsCacheEnabled) {
|
||||
device.getExecutionEnvironment()->initializeUnifiedMemoryReuseCleaner(!device.isAnyDirectSubmissionEnabled(true));
|
||||
device.getExecutionEnvironment()->initializeUnifiedMemoryReuseCleaner(!device.isAnyDirectSubmissionLightEnabled());
|
||||
this->initUsmHostAllocationsCache();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -168,7 +168,7 @@ class MockDevice : public RootDevice {
|
||||
rtDispatchGlobalsForceAllocation = true;
|
||||
}
|
||||
|
||||
bool isAnyDirectSubmissionEnabled(bool light) const override {
|
||||
bool isAnyDirectSubmissionEnabledImpl(bool light) const override {
|
||||
return anyDirectSubmissionEnabledReturnValue;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user