Add isBlitterForImagesSupported helper

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2021-04-22 13:11:33 +00:00
committed by Compute-Runtime-Automation
parent 52301e6a40
commit 7a5e0e13a5
6 changed files with 27 additions and 8 deletions

View File

@ -438,8 +438,9 @@ HWTEST_F(EnqueueReadImageTest, givenDeviceWithBlitterSupportWhenEnqueueReadImage
DebugManager.flags.EnableBlitterForEnqueueOperations.set(1);
DebugManager.flags.EnableBlitterForReadWriteImage.set(1);
auto &capabilityTable = pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable;
capabilityTable.blitterOperationsSupported = true;
auto hwInfo = pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
hwInfo->capabilityTable.blitterOperationsSupported = true;
size_t origin[] = {0, 0, 0};
auto mockCmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(context, pClDevice, nullptr);
std::unique_ptr<Image> image(Image2dHelper<>::create(context));
@ -457,7 +458,8 @@ HWTEST_F(EnqueueReadImageTest, givenDeviceWithBlitterSupportWhenEnqueueReadImage
DebugManager.flags.EnableBlitterForReadWriteImage.set(-1);
size_t region[] = {BlitterConstants::maxBlitWidth, BlitterConstants::maxBlitHeight, 1};
EnqueueReadImageHelper<>::enqueueReadImage(mockCmdQ.get(), image.get(), CL_TRUE, origin, region);
EXPECT_FALSE(mockCmdQ->isBlitEnqueueImageAllowed);
auto supportExpected = hwHelper.isBlitterForImagesSupported(*hwInfo);
EXPECT_EQ(supportExpected, mockCmdQ->isBlitEnqueueImageAllowed);
}
{
DebugManager.flags.EnableBlitterForReadWriteImage.set(0);

View File

@ -213,8 +213,9 @@ HWTEST_F(EnqueueWriteImageTest, givenDeviceWithBlitterSupportWhenEnqueueWriteIma
DebugManager.flags.EnableBlitterForEnqueueOperations.set(1);
DebugManager.flags.EnableBlitterForReadWriteImage.set(1);
auto &capabilityTable = pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo()->capabilityTable;
capabilityTable.blitterOperationsSupported = true;
auto hwInfo = pClDevice->getRootDeviceEnvironment().getMutableHardwareInfo();
auto &hwHelper = HwHelper::get(hwInfo->platform.eRenderCoreFamily);
hwInfo->capabilityTable.blitterOperationsSupported = true;
size_t origin[] = {0, 0, 0};
auto mockCmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(context, pClDevice, nullptr);
std::unique_ptr<Image> image(Image2dHelper<>::create(context));
@ -232,7 +233,8 @@ HWTEST_F(EnqueueWriteImageTest, givenDeviceWithBlitterSupportWhenEnqueueWriteIma
DebugManager.flags.EnableBlitterForReadWriteImage.set(-1);
size_t region[] = {BlitterConstants::maxBlitWidth, BlitterConstants::maxBlitHeight, 1};
EnqueueWriteImageHelper<>::enqueueWriteImage(mockCmdQ.get(), image.get(), CL_FALSE, origin, region);
EXPECT_FALSE(mockCmdQ->isBlitEnqueueImageAllowed);
auto supportExpected = hwHelper.isBlitterForImagesSupported(*hwInfo);
EXPECT_EQ(supportExpected, mockCmdQ->isBlitEnqueueImageAllowed);
}
{
DebugManager.flags.EnableBlitterForReadWriteImage.set(0);

View File

@ -1203,6 +1203,11 @@ HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenGettingPlanarYuvHeigh
EXPECT_EQ(helper.getPlanarYuvMaxHeight(), 16352u);
}
HWTEST_F(HwHelperTest, givenHwHelperWhenIsBlitterForImagesSupportedIsCalledThenFalseIsReturned) {
auto &helper = HwHelper::get(renderCoreFamily);
EXPECT_FALSE(helper.isBlitterForImagesSupported(*defaultHwInfo));
}
HWCMDTEST_F(IGFX_GEN8_CORE, HwHelperTest, givenHwHelperWhenAdditionalKernelExecInfoSupportCheckedThenReturnFalse) {
auto &helper = HwHelper::get(renderCoreFamily);