Improve PipeControlHelper

Change-Id: I8d553ec82026399225e452529044a0470afe7963
Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2019-07-10 11:21:16 +02:00
committed by sys_ocldev
parent 8a3f215dff
commit 878928caee
10 changed files with 42 additions and 28 deletions

View File

@@ -11,6 +11,7 @@
#include "runtime/gmm_helper/gmm_helper.h"
#include "runtime/gmm_helper/resource_info.h"
#include "runtime/helpers/aligned_memory.h"
#include "runtime/helpers/hardware_commands_helper.h"
#include "runtime/helpers/options.h"
#include "runtime/helpers/string.h"
#include "runtime/memory_manager/graphics_allocation.h"
@@ -203,6 +204,21 @@ HWTEST_F(PipeControlHelperTests, givenPostSyncWriteTimestampModeWhenHelperIsUsed
EXPECT_TRUE(memcmp(pipeControl, &expectedPipeControl, sizeof(PIPE_CONTROL)) == 0);
}
HWTEST_F(PipeControlHelperTests, whenQueryingPipeControlSizeWithoutWaThenReturnSinglePipeControlSize) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
auto size = PipeControlHelper<FamilyType>::getRequiredPipeControlSize(false);
EXPECT_EQ(sizeof(PIPE_CONTROL), size);
}
HWTEST_F(PipeControlHelperTests, whenQueryingPipeControlSizeWithWaThenReturnValidPipeControlSize) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
auto size = PipeControlHelper<FamilyType>::getRequiredPipeControlSize(true);
size_t pipeControlsCount = HardwareCommandsHelper<FamilyType>::isPipeControlWArequired() ? 2 : 1;
EXPECT_EQ(sizeof(PIPE_CONTROL) * pipeControlsCount, size);
}
HWTEST_F(PipeControlHelperTests, givenPostSyncWriteImmediateDataModeWhenHelperIsUsedThenProperFieldsAreProgrammed) {
using PIPE_CONTROL = typename FamilyType::PIPE_CONTROL;
std::unique_ptr<uint8_t> buffer(new uint8_t[128]);