2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2018-01-17 15:37:47 +08:00
|
|
|
#include "test.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
#include "unit_tests/fixtures/media_kernel_fixture.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-01-17 15:37:47 +08:00
|
|
|
typedef MediaKernelFixture<HelloWorldFixtureFactory> MediaKernelTest;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
2018-01-17 15:37:47 +08:00
|
|
|
GEN8TEST_F(MediaKernelTest, givenGen8CSRWhenEnqueueVmeKernelThenProgramOnlyPipelineSelection) {
|
|
|
|
typedef typename BDWFamily::PIPELINE_SELECT PIPELINE_SELECT;
|
2017-12-21 07:45:38 +08:00
|
|
|
enqueueVmeKernel<FamilyType>();
|
2018-01-17 15:37:47 +08:00
|
|
|
auto pCmd = getCommand<PIPELINE_SELECT>();
|
|
|
|
auto expectedMask = pipelineSelectEnablePipelineSelectMaskBits;
|
|
|
|
auto expectedPipelineSelection = PIPELINE_SELECT::PIPELINE_SELECTION_GPGPU;
|
|
|
|
EXPECT_EQ(expectedMask, pCmd->getMaskBits());
|
|
|
|
EXPECT_EQ(expectedPipelineSelection, pCmd->getPipelineSelection());
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
2018-01-19 20:29:25 +08:00
|
|
|
|
|
|
|
GEN8TEST_F(MediaKernelTest, givenGen8CsrWhenEnqueueVmeKernelThenVmeSubslicesConfigDoesntChangeToFalse) {
|
|
|
|
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getCommandStreamReceiver());
|
|
|
|
csr->lastVmeSubslicesConfig = true;
|
|
|
|
enqueueVmeKernel<FamilyType>();
|
|
|
|
EXPECT_TRUE(csr->lastVmeSubslicesConfig);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN8TEST_F(MediaKernelTest, givenGen8CsrWhenEnqueueVmeKernelThenVmeSubslicesConfigDoesntChangeToTrue) {
|
|
|
|
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getCommandStreamReceiver());
|
|
|
|
csr->lastVmeSubslicesConfig = false;
|
|
|
|
enqueueVmeKernel<FamilyType>();
|
|
|
|
EXPECT_FALSE(csr->lastVmeSubslicesConfig);
|
|
|
|
}
|
|
|
|
|
|
|
|
GEN8TEST_F(MediaKernelTest, gen8CmdSizeForMediaSampler) {
|
|
|
|
auto csr = static_cast<UltCommandStreamReceiver<FamilyType> *>(&pDevice->getCommandStreamReceiver());
|
|
|
|
|
|
|
|
csr->lastVmeSubslicesConfig = false;
|
|
|
|
EXPECT_EQ(0u, csr->getCmdSizeForMediaSampler(false));
|
|
|
|
EXPECT_EQ(0u, csr->getCmdSizeForMediaSampler(true));
|
|
|
|
|
|
|
|
csr->lastVmeSubslicesConfig = true;
|
|
|
|
EXPECT_EQ(0u, csr->getCmdSizeForMediaSampler(false));
|
|
|
|
EXPECT_EQ(0u, csr->getCmdSizeForMediaSampler(true));
|
2018-04-24 23:33:01 +08:00
|
|
|
}
|