|
|
|
@ -16,6 +16,8 @@
|
|
|
|
|
#include "level_zero/core/test/unit_tests/mocks/mock_cmdqueue.h"
|
|
|
|
|
#include "level_zero/core/test/unit_tests/mocks/mock_module.h"
|
|
|
|
|
|
|
|
|
|
#include "test_traits_common.h"
|
|
|
|
|
|
|
|
|
|
namespace L0 {
|
|
|
|
|
namespace ult {
|
|
|
|
|
|
|
|
|
@ -164,8 +166,15 @@ HWTEST2_F(CommandListCreate, whenCommandListIsCreatedThenFlagsAreCorrectlySet, P
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
using CommandListAppendLaunchKernel = Test<ModuleFixture>;
|
|
|
|
|
HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModePropertiesWhenUpdateStreamPropertiesIsCalledTwiceThenChangedFieldsAreDirty, IsAtLeastGen12lp) {
|
|
|
|
|
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
|
|
|
|
struct ProgramChangedFieldsInComputeMode {
|
|
|
|
|
template <PRODUCT_FAMILY productFamily>
|
|
|
|
|
static constexpr bool isMatched() {
|
|
|
|
|
if (productFamily == IGFX_BROADWELL)
|
|
|
|
|
return false;
|
|
|
|
|
return TestTraits<NEO::ToGfxCoreFamily<productFamily>::get()>::programOnlyChangedFieldsInComputeStateMode;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModePropertiesWhenUpdateStreamPropertiesIsCalledTwiceThenChangedFieldsAreDirty, ProgramChangedFieldsInComputeMode) {
|
|
|
|
|
DebugManagerStateRestore restorer;
|
|
|
|
|
|
|
|
|
|
Mock<::L0::Kernel> kernel;
|
|
|
|
@ -184,15 +193,37 @@ HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModePropertiesWhenUpdateStr
|
|
|
|
|
const_cast<NEO::KernelDescriptor *>(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x80;
|
|
|
|
|
pCommandList->updateStreamProperties(kernel, false, false);
|
|
|
|
|
EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty);
|
|
|
|
|
if (IsXEHP::isMatched<productFamily>()) {
|
|
|
|
|
EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty);
|
|
|
|
|
} else {
|
|
|
|
|
EXPECT_FALSE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty);
|
|
|
|
|
EXPECT_FALSE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty);
|
|
|
|
|
}
|
|
|
|
|
struct ProgramAllFieldsInComputeMode {
|
|
|
|
|
template <PRODUCT_FAMILY productFamily>
|
|
|
|
|
static constexpr bool isMatched() {
|
|
|
|
|
return !TestTraits<NEO::ToGfxCoreFamily<productFamily>::get()>::programOnlyChangedFieldsInComputeStateMode;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModeTraitsSetToFalsePropertiesWhenUpdateStreamPropertiesIsCalledTwiceThenAllFieldsAreDirty, ProgramAllFieldsInComputeMode) {
|
|
|
|
|
DebugManagerStateRestore restorer;
|
|
|
|
|
|
|
|
|
|
Mock<::L0::Kernel> kernel;
|
|
|
|
|
auto pMockModule = std::unique_ptr<Module>(new Mock<Module>(device, nullptr));
|
|
|
|
|
kernel.module = pMockModule.get();
|
|
|
|
|
|
|
|
|
|
auto pCommandList = std::make_unique<WhiteBox<::L0::CommandListCoreFamily<gfxCoreFamily>>>();
|
|
|
|
|
auto result = pCommandList->initialize(device, NEO::EngineGroupType::Compute, 0u);
|
|
|
|
|
ASSERT_EQ(ZE_RESULT_SUCCESS, result);
|
|
|
|
|
|
|
|
|
|
const_cast<NEO::KernelDescriptor *>(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x100;
|
|
|
|
|
pCommandList->updateStreamProperties(kernel, false, false);
|
|
|
|
|
EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty);
|
|
|
|
|
EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty);
|
|
|
|
|
|
|
|
|
|
const_cast<NEO::KernelDescriptor *>(&kernel.getKernelDescriptor())->kernelAttributes.numGrfRequired = 0x80;
|
|
|
|
|
pCommandList->updateStreamProperties(kernel, false, false);
|
|
|
|
|
EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.largeGrfMode.isDirty);
|
|
|
|
|
EXPECT_TRUE(pCommandList->finalStreamState.stateComputeMode.isCoherencyRequired.isDirty);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModePropertiesWhenPropertesNotChangedThenAllFieldsAreNotDirty, IsAtLeastGen12lp) {
|
|
|
|
|
using STATE_COMPUTE_MODE = typename FamilyType::STATE_COMPUTE_MODE;
|
|
|
|
|
HWTEST2_F(CommandListAppendLaunchKernel, GivenComputeModePropertiesWhenPropertesNotChangedThenAllFieldsAreNotDirty, Platforms) {
|
|
|
|
|
DebugManagerStateRestore restorer;
|
|
|
|
|
|
|
|
|
|
Mock<::L0::Kernel> kernel;
|
|
|
|
|