Set valid "max number of threads" in MEDIA_VFE_STATE

Change-Id: Icd55fe6b5cae5a92021d2692fe09c19535e64121
This commit is contained in:
Stefanowski, Adam
2018-06-22 13:04:02 +02:00
committed by sys_ocldev
parent 49d5ebef0d
commit 623314665b
26 changed files with 76 additions and 219 deletions

View File

@ -76,7 +76,8 @@ const RuntimeCapabilityTable CNL::capabilityTable{
MemoryConstants::pageSize, //requiredPreemptionSurfaceSize
true,
true, // sourceLevelDebuggerSupported
CmdServicesMemTraceVersion::DeviceValues::Cnl};
CmdServicesMemTraceVersion::DeviceValues::Cnl,
0}; // extraQuantityThreadsPerEU
const HardwareInfo CNL_2x5x8::hwInfo = {
&CNL::platform,

View File

@ -77,7 +77,8 @@ const RuntimeCapabilityTable BDW::capabilityTable{
MemoryConstants::pageSize, //requiredPreemptionSurfaceSize
true, // isCore
false, // sourceLevelDebuggerSupported
CmdServicesMemTraceVersion::DeviceValues::Bdw};
CmdServicesMemTraceVersion::DeviceValues::Bdw,
0}; // extraQuantityThreadsPerEU
const HardwareInfo BDW_1x2x6::hwInfo = {
&BDW::platform,

View File

@ -74,7 +74,8 @@ const RuntimeCapabilityTable BXT::capabilityTable{
MemoryConstants::pageSize, //requiredPreemptionSurfaceSize
false, // isCore
true, // sourceLevelDebuggerSupported
CmdServicesMemTraceVersion::DeviceValues::Bxt};
CmdServicesMemTraceVersion::DeviceValues::Bxt,
0}; // extraQuantityThreadsPerEU
const HardwareInfo BXT_1x2x6::hwInfo = {
&BXT::platform,

View File

@ -69,7 +69,8 @@ const RuntimeCapabilityTable CFL::capabilityTable{
MemoryConstants::pageSize, //requiredPreemptionSurfaceSize
true, // isCore
true, // sourceLevelDebuggerSupported
CmdServicesMemTraceVersion::DeviceValues::Cfl};
CmdServicesMemTraceVersion::DeviceValues::Cfl,
0}; // extraQuantityThreadsPerEU
const HardwareInfo CFL_1x2x6::hwInfo = {
&CFL::platform,

View File

@ -69,7 +69,8 @@ const RuntimeCapabilityTable GLK::capabilityTable{
MemoryConstants::pageSize, //requiredPreemptionSurfaceSize
false, // isCore
true, // sourceLevelDebuggerSupported
CmdServicesMemTraceVersion::DeviceValues::Glk};
CmdServicesMemTraceVersion::DeviceValues::Glk,
0}; // extraQuantityThreadsPerEU
const HardwareInfo GLK_1x3x6::hwInfo = {
&GLK::platform,

View File

@ -69,7 +69,8 @@ const RuntimeCapabilityTable KBL::capabilityTable{
MemoryConstants::pageSize, //requiredPreemptionSurfaceSize
true, // isCore
true, // sourceLevelDebuggerSupported
CmdServicesMemTraceVersion::DeviceValues::Kbl};
CmdServicesMemTraceVersion::DeviceValues::Kbl,
0}; // extraQuantityThreadsPerEU
const HardwareInfo KBL_1x2x6::hwInfo = {
&KBL::platform,

View File

@ -77,7 +77,8 @@ const RuntimeCapabilityTable SKL::capabilityTable{
MemoryConstants::pageSize, //requiredPreemptionSurfaceSize
true, // isCore
true, // sourceLevelDebuggerSupported
CmdServicesMemTraceVersion::DeviceValues::Skl};
CmdServicesMemTraceVersion::DeviceValues::Skl,
0}; // extraQuantityThreadsPerEU
const HardwareInfo SKL_1x2x6::hwInfo = {
&SKL::platform,

View File

@ -76,6 +76,8 @@ struct RuntimeCapabilityTable {
bool isCore;
bool sourceLevelDebuggerSupported;
uint32_t aubDeviceId;
uint32_t extraQuantityThreadsPerEU;
};
struct HardwareCapabilities {

View File

@ -56,6 +56,7 @@ struct PreambleHelper {
static size_t getKernelDebuggingCommandsSize(bool debuggingActive);
static void programGenSpecificPreambleWorkArounds(LinearStream *pCommandStream, const HardwareInfo &hwInfo);
static uint32_t getUrbEntryAllocationSize();
static uint32_t getMaxThreadsForVfe(const HardwareInfo &hwInfo);
};
template <PRODUCT_FAMILY ProductFamily>

View File

@ -64,7 +64,7 @@ void PreambleHelper<GfxFamily>::programVFEState(LinearStream *pCommandStream, co
auto pMediaVfeState = (MEDIA_VFE_STATE *)pCommandStream->getSpace(sizeof(MEDIA_VFE_STATE));
*pMediaVfeState = MEDIA_VFE_STATE::sInit();
pMediaVfeState->setMaximumNumberOfThreads(hwInfo.pSysInfo->ThreadCount);
pMediaVfeState->setMaximumNumberOfThreads(PreambleHelper<GfxFamily>::getMaxThreadsForVfe(hwInfo));
pMediaVfeState->setNumberOfUrbEntries(1);
pMediaVfeState->setUrbEntryAllocationSize(PreambleHelper<GfxFamily>::getUrbEntryAllocationSize());
pMediaVfeState->setPerThreadScratchSpace(Kernel::getScratchSizeValueToProgramMediaVfeState(scratchSize));
@ -127,4 +127,10 @@ size_t PreambleHelper<GfxFamily>::getKernelDebuggingCommandsSize(bool debuggingA
return 0;
}
template <typename GfxFamily>
uint32_t PreambleHelper<GfxFamily>::getMaxThreadsForVfe(const HardwareInfo &hwInfo) {
uint32_t threadsPerEU = (hwInfo.pSysInfo->ThreadCount / hwInfo.pSysInfo->EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU;
return hwInfo.pSysInfo->EUCount * threadsPerEU;
}
} // namespace OCLRT

View File

@ -260,19 +260,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, 2D_PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, 2D_MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueCopyBufferRect2D<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, 3D_GPGPUWalker) {
@ -393,18 +382,6 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, 3D_PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferRectTest, 3D_MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueCopyBufferRect3D<FamilyType>();
auto cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
ASSERT_NE(nullptr, cmd);
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}

View File

@ -228,20 +228,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferTest, PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferTest, MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueCopyBufferAndParse<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
ASSERT_NE(nullptr, cmd);
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferTest, argumentZeroShouldMatchSourceAddress) {

View File

@ -193,19 +193,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferToImageTest, pipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyBufferToImageTest, mediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueCopyBufferToImage<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
typedef EnqueueCopyBufferToImageMipMapTest MipMapCopyBufferToImageTest;

View File

@ -202,19 +202,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageTest, pipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageTest, mediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueCopyImage<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
typedef EnqueueCopyImageMipMapTest MipMapCopyImageTest;

View File

@ -194,19 +194,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageToBufferTest, pipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueCopyImageToBufferTest, mediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueCopyImageToBuffer<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
typedef EnqueueCopyImageToBufferMipMapTest MipMapCopyImageToBufferTest;

View File

@ -278,20 +278,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillBufferCmdTests, PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillBufferCmdTests, MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueFillBuffer<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
ASSERT_NE(nullptr, cmd);
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillBufferCmdTests, argumentZeroShouldMatchDestAddress) {

View File

@ -196,19 +196,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillImageTest, pipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueFillImageTest, mediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueFillImage<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
TEST_F(EnqueueFillImageTest, sRGBConvert) {

View File

@ -516,28 +516,8 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueWorkItemTests, PipelineSelect) {
}
HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueWorkItemTests, MediaVFEState) {
typedef typename FamilyType::PARSE PARSE;
typedef typename PARSE::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueKernel<FamilyType>();
// All state should be programmed before walker
auto itorCmd = find<MEDIA_VFE_STATE *>(itorPipelineSelect, itorWalker);
ASSERT_NE(itorWalker, itorCmd);
auto *cmd = (MEDIA_VFE_STATE *)*itorCmd;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_EQ(1u, cmd->getNumberOfUrbEntries());
uint32_t expectedVal = PreambleHelper<FamilyType>::getUrbEntryAllocationSize();
EXPECT_EQ(expectedVal, cmd->getUrbEntryAllocationSize());
EXPECT_EQ(0u, cmd->getScratchSpaceBasePointer());
EXPECT_EQ(0u, cmd->getPerThreadScratchSpace());
EXPECT_EQ(0u, cmd->getStackSize());
// Generically validate this command
PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorCmd);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
INSTANTIATE_TEST_CASE_P(EnqueueKernel,
@ -586,8 +566,12 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueScratchSpaceTests, GivenKernelRequiringScratc
auto *cmd = (MEDIA_VFE_STATE *)*itorCmd;
auto *sba = (STATE_BASE_ADDRESS *)*itorCmdForStateBase;
const HardwareInfo &hwInfo = **platformDevices;
uint32_t threadPerEU = (hwInfo.pSysInfo->ThreadCount / hwInfo.pSysInfo->EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU;
uint32_t maxNumberOfThreads = hwInfo.pSysInfo->EUCount * threadPerEU;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_EQ(maxNumberOfThreads, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
EXPECT_EQ(bitValue, cmd->getPerThreadScratchSpace());
@ -635,7 +619,7 @@ HWCMDTEST_P(IGFX_GEN8_CORE, EnqueueScratchSpaceTests, GivenKernelRequiringScratc
auto *cmd2 = (MEDIA_VFE_STATE *)*itorCmd;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd2->getMaximumNumberOfThreads());
EXPECT_EQ(maxNumberOfThreads, cmd2->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd2->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd2->getUrbEntryAllocationSize());
EXPECT_EQ(bitValue, cmd2->getPerThreadScratchSpace());

View File

@ -294,23 +294,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferRectTest, 2D_PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferRectTest, 2D_MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueReadBufferRect2D<FamilyType>();
// All state should be programmed before walker
auto itorCmd = find<MEDIA_VFE_STATE *>(itorPipelineSelect, itorWalker);
ASSERT_NE(itorWalker, itorCmd);
auto *cmd = (MEDIA_VFE_STATE *)*itorCmd;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorCmd);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferRectTest, blockingRequiresPipeControlAfterWalkerWithDCFlushSet) {

View File

@ -262,24 +262,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferTypeTest, PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferTypeTest, MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
srcBuffer->forceDisallowCPUCopy = true;
enqueueReadBuffer<FamilyType>();
// All state should be programmed before walker
auto itorCmd = find<MEDIA_VFE_STATE *>(itorPipelineSelect, itorWalker);
ASSERT_NE(itorWalker, itorCmd);
auto *cmd = (MEDIA_VFE_STATE *)*itorCmd;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorCmd);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadBufferTypeTest, blockingRequiresPipeControlAfterWalkerWithDCFlushSet) {

View File

@ -198,19 +198,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadImageTest, pipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadImageTest, mediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueReadImage<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueReadImageTest, blockingEnqueueRequiresPCWithDCFlushSetAfterWalker) {

View File

@ -268,23 +268,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferRectTest, 2D_PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferRectTest, 2D_MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueWriteBufferRect2D<FamilyType>();
// All state should be programmed before walker
auto itorCmd = find<MEDIA_VFE_STATE *>(itorPipelineSelect, itorWalker);
ASSERT_NE(itorWalker, itorCmd);
auto *cmd = (MEDIA_VFE_STATE *)*itorCmd;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorCmd);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWTEST_F(EnqueueWriteBufferRectTest, givenInOrderQueueAndDstPtrEqualSrcPtrWhenWriteBufferIsExecutedThenTaskLevelShouldNotBeIncreased) {
cl_int retVal = CL_SUCCESS;

View File

@ -258,24 +258,9 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferTypeTest, PipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteBufferTypeTest, MediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
srcBuffer->forceDisallowCPUCopy = true;
enqueueWriteBuffer<FamilyType>();
// All state should be programmed before walker
auto itorCmd = find<MEDIA_VFE_STATE *>(itorPipelineSelect, itorWalker);
ASSERT_NE(itorWalker, itorCmd);
auto *cmd = (MEDIA_VFE_STATE *)*itorCmd;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorCmd);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWTEST_F(EnqueueWriteBufferTypeTest, givenOOQWithEnabledSupportCpuCopiesAndDstPtrEqualSrcPtrAndZeroCopyBufferTrueWhenWriteBufferIsExecutedThenTaskLevelNotIncreased) {
DebugManagerStateRestore dbgRestore;

View File

@ -200,19 +200,8 @@ HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteImageTest, pipelineSelect) {
}
HWCMDTEST_F(IGFX_GEN8_CORE, EnqueueWriteImageTest, mediaVFEState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
enqueueWriteImage<FamilyType>();
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
// Verify we have a valid length
EXPECT_EQ(pDevice->getHardwareInfo().pSysInfo->ThreadCount, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
validateMediaVFEState<FamilyType>(&pDevice->getHardwareInfo(), cmdMediaVfeState, cmdList, itorMediaVfeState);
}
HWTEST_F(EnqueueWriteImageTest, GivenImage1DarrayWhenReadWriteImageIsCalledThenHostPtrSizeIsCalculatedProperly) {

View File

@ -98,4 +98,25 @@ void validateL3Programming(GenCmdList &cmdList, GenCmdList::iterator &itorWalker
ASSERT_EQ(itorWalker, itorCmd);
}
}
template <typename FamilyType>
void validateMediaVFEState(const HardwareInfo *hwInfo, void *cmdMediaVfeState, GenCmdList &cmdList, GenCmdList::iterator itorMediaVfeState) {
typedef typename FamilyType::MEDIA_VFE_STATE MEDIA_VFE_STATE;
auto *cmd = (MEDIA_VFE_STATE *)cmdMediaVfeState;
ASSERT_NE(nullptr, cmd);
uint32_t threadPerEU = (hwInfo->pSysInfo->ThreadCount / hwInfo->pSysInfo->EUCount) + hwInfo->capabilityTable.extraQuantityThreadsPerEU;
uint32_t expected = hwInfo->pSysInfo->EUCount * threadPerEU;
EXPECT_EQ(expected, cmd->getMaximumNumberOfThreads());
EXPECT_NE(0u, cmd->getNumberOfUrbEntries());
EXPECT_NE(0u, cmd->getUrbEntryAllocationSize());
EXPECT_EQ(0u, cmd->getScratchSpaceBasePointer());
EXPECT_EQ(0u, cmd->getPerThreadScratchSpace());
EXPECT_EQ(0u, cmd->getStackSize());
// Generically validate this command
FamilyType::PARSE::template validateCommand<MEDIA_VFE_STATE *>(cmdList.begin(), itorMediaVfeState);
}
} // namespace OCLRT

View File

@ -171,6 +171,15 @@ HWTEST_F(PreambleTest, givenKernelDebuggingActiveAndMidThreadPreemptionWhenGetAd
EXPECT_EQ(sizeExpected, diff);
}
HWTEST_F(PreambleTest, givenDefaultPreambleWhenGetThreadsMaxNumberIsCalledThenMaximumNumberOfThreadsIsReturned) {
const HardwareInfo &hwInfo = **platformDevices;
uint32_t threadsPerEU = (hwInfo.pSysInfo->ThreadCount / hwInfo.pSysInfo->EUCount) + hwInfo.capabilityTable.extraQuantityThreadsPerEU;
uint32_t value = PreambleHelper<FamilyType>::getMaxThreadsForVfe(hwInfo);
uint32_t expected = hwInfo.pSysInfo->EUCount * threadsPerEU;
EXPECT_EQ(expected, value);
}
TEST(DefaultPreambleHelperTest, givenDefaultPreambleHelperWhenGetAdditionalCommandsSizeThenZeroIsReturned) {
auto size = PreambleHelper<GENX>::getAdditionalCommandsSize(MockDevice(**platformDevices));
EXPECT_EQ(0u, size);
@ -183,4 +192,4 @@ TEST(DefaultPreambleHelperTest, givenDefaultPreambleHelperWhenProgramGenSpecific
PreambleHelper<GENX>::programGenSpecificPreambleWorkArounds(&preambleStream, **platformDevices);
EXPECT_EQ(size, preambleStream.getUsed());
}
}