mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 09:14:47 +08:00
Move hwHelper ownership to RootDeviceEnvironment 5/n
Related-To: NEO-6853 Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> UseRootDeviceEnvironment getHelper<CoreHelper> for - isFenceAllocationRequired Move common implementation to pvc_and_later file.
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
211cc8552a
commit
1bcceb1071
@@ -49,5 +49,6 @@ HelperType &ClDeviceFixture::getHelper() const {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template ProductHelper &ClDeviceFixture::getHelper() const;
|
template ProductHelper &ClDeviceFixture::getHelper() const;
|
||||||
|
template CoreHelper &ClDeviceFixture::getHelper() const;
|
||||||
|
|
||||||
} // namespace NEO
|
} // namespace NEO
|
||||||
|
|||||||
@@ -590,32 +590,32 @@ XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenHwHelperWhenAskedIfFenceAllocatio
|
|||||||
DebugManagerStateRestore dbgRestore;
|
DebugManagerStateRestore dbgRestore;
|
||||||
|
|
||||||
auto hwInfo = *defaultHwInfo;
|
auto hwInfo = *defaultHwInfo;
|
||||||
auto &helper = HwHelper::get(renderCoreFamily);
|
auto &coreHelper = getHelper<CoreHelper>();
|
||||||
|
|
||||||
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(-1);
|
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(-1);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(-1);
|
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(-1);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(-1);
|
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(-1);
|
||||||
EXPECT_TRUE(helper.isFenceAllocationRequired(hwInfo));
|
EXPECT_TRUE(coreHelper.isFenceAllocationRequired(hwInfo));
|
||||||
|
|
||||||
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(0);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(0);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(0);
|
||||||
EXPECT_FALSE(helper.isFenceAllocationRequired(hwInfo));
|
EXPECT_FALSE(coreHelper.isFenceAllocationRequired(hwInfo));
|
||||||
|
|
||||||
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(1);
|
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(1);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(0);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(0);
|
||||||
EXPECT_TRUE(helper.isFenceAllocationRequired(hwInfo));
|
EXPECT_TRUE(coreHelper.isFenceAllocationRequired(hwInfo));
|
||||||
|
|
||||||
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(0);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(1);
|
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(1);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(0);
|
||||||
EXPECT_TRUE(helper.isFenceAllocationRequired(hwInfo));
|
EXPECT_TRUE(coreHelper.isFenceAllocationRequired(hwInfo));
|
||||||
|
|
||||||
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.set(0);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(0);
|
DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.set(0);
|
||||||
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(1);
|
DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.set(1);
|
||||||
EXPECT_TRUE(helper.isFenceAllocationRequired(hwInfo));
|
EXPECT_TRUE(coreHelper.isFenceAllocationRequired(hwInfo));
|
||||||
}
|
}
|
||||||
|
|
||||||
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenDontProgramGlobalFenceAsMiMemFenceCommandInCommandStreamWhenGettingSizeForAdditionalSynchronizationThenCorrectValueIsReturned) {
|
XE_HPC_CORETEST_F(HwHelperTestsXeHpcCore, givenDontProgramGlobalFenceAsMiMemFenceCommandInCommandStreamWhenGettingSizeForAdditionalSynchronizationThenCorrectValueIsReturned) {
|
||||||
|
|||||||
@@ -722,8 +722,10 @@ bool CommandStreamReceiver::createWorkPartitionAllocation(const Device &device)
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool CommandStreamReceiver::createGlobalFenceAllocation() {
|
bool CommandStreamReceiver::createGlobalFenceAllocation() {
|
||||||
auto hwInfo = executionEnvironment.rootDeviceEnvironments[rootDeviceIndex]->getHardwareInfo();
|
auto &rootDevicEnvironment = *executionEnvironment.rootDeviceEnvironments[rootDeviceIndex].get();
|
||||||
if (!HwHelper::get(hwInfo->platform.eRenderCoreFamily).isFenceAllocationRequired(*hwInfo)) {
|
auto &coreHelper = rootDevicEnvironment.getHelper<CoreHelper>();
|
||||||
|
auto &hwInfo = *rootDevicEnvironment.getHardwareInfo();
|
||||||
|
if (!coreHelper.isFenceAllocationRequired(hwInfo)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,16 @@
|
|||||||
|
|
||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
|
template <>
|
||||||
|
bool HwHelperHw<Family>::isFenceAllocationRequired(const HardwareInfo &hwInfo) const {
|
||||||
|
if ((DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get() == 0) &&
|
||||||
|
(DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.get() == 0) &&
|
||||||
|
(DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.get() == 0)) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool HwHelperHw<Family>::isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const {
|
bool HwHelperHw<Family>::isCpuImageTransferPreferred(const HardwareInfo &hwInfo) const {
|
||||||
return !hwInfo.capabilityTable.supportsImages;
|
return !hwInfo.capabilityTable.supportsImages;
|
||||||
|
|||||||
@@ -125,16 +125,6 @@ uint32_t HwHelperHw<Family>::getMinimalSIMDSize() {
|
|||||||
return 16u;
|
return 16u;
|
||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
|
||||||
bool HwHelperHw<Family>::isFenceAllocationRequired(const HardwareInfo &hwInfo) const {
|
|
||||||
if ((DebugManager.flags.ProgramGlobalFenceAsMiMemFenceCommandInCommandStream.get() == 0) &&
|
|
||||||
(DebugManager.flags.ProgramGlobalFenceAsPostSyncOperationInComputeWalker.get() == 0) &&
|
|
||||||
(DebugManager.flags.ProgramGlobalFenceAsKernelInstructionInEUKernel.get() == 0)) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
uint32_t HwHelperHw<Family>::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const {
|
uint32_t HwHelperHw<Family>::getMocsIndex(const GmmHelper &gmmHelper, bool l3enabled, bool l1enabled) const {
|
||||||
if (l3enabled) {
|
if (l3enabled) {
|
||||||
|
|||||||
Reference in New Issue
Block a user