2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2020-02-22 22:21:06 +01:00
|
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
2020-03-31 07:43:07 +02:00
|
|
|
#include "shared/test/unit_test/cmd_parse/hw_parse.h"
|
|
|
|
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/command_queue/enqueue_fixture.h"
|
|
|
|
|
2019-02-27 11:39:32 +01:00
|
|
|
#include "hello_world_fixture.h"
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2017-12-21 00:45:38 +01:00
|
|
|
|
|
|
|
// Generates two back-to-back walkers using the same kernel for testing purposes
|
|
|
|
template <typename FactoryType>
|
|
|
|
struct TwoWalkerTest
|
|
|
|
: public HelloWorldTest<FactoryType>,
|
|
|
|
public HardwareParse {
|
|
|
|
typedef HelloWorldTest<FactoryType> Parent;
|
|
|
|
|
2018-06-12 21:54:39 +02:00
|
|
|
using Parent::pCmdBuffer;
|
2017-12-21 00:45:38 +01:00
|
|
|
using Parent::pCmdQ;
|
|
|
|
using Parent::pCS;
|
|
|
|
using Parent::pKernel;
|
|
|
|
|
|
|
|
template <typename FamilyType>
|
|
|
|
void enqueueTwoKernels() {
|
|
|
|
auto retVal = EnqueueKernelHelper<>::enqueueKernel(
|
|
|
|
pCmdQ,
|
|
|
|
pKernel);
|
|
|
|
ASSERT_EQ(CL_SUCCESS, retVal);
|
|
|
|
|
|
|
|
// We have to parse after each enqueue* because
|
|
|
|
// the CSR CS may insert commands in between
|
|
|
|
parseCommands<FamilyType>(*pCmdQ);
|
|
|
|
|
|
|
|
retVal = EnqueueKernelHelper<>::enqueueKernel(
|
|
|
|
pCmdQ,
|
|
|
|
pKernel);
|
|
|
|
ASSERT_EQ(CL_SUCCESS, retVal);
|
|
|
|
|
|
|
|
parseCommands<FamilyType>(*pCmdQ);
|
|
|
|
|
2018-10-01 11:57:36 +02:00
|
|
|
itorWalker1 = find<typename FamilyType::WALKER_TYPE *>(cmdList.begin(), cmdList.end());
|
2017-12-21 00:45:38 +01:00
|
|
|
ASSERT_NE(cmdList.end(), itorWalker1);
|
|
|
|
|
|
|
|
itorWalker2 = itorWalker1;
|
|
|
|
++itorWalker2;
|
2018-10-01 11:57:36 +02:00
|
|
|
itorWalker2 = find<typename FamilyType::WALKER_TYPE *>(itorWalker2, cmdList.end());
|
2017-12-21 00:45:38 +01:00
|
|
|
ASSERT_NE(cmdList.end(), itorWalker2);
|
|
|
|
}
|
|
|
|
|
|
|
|
void SetUp() override {
|
|
|
|
Parent::SetUp();
|
|
|
|
HardwareParse::SetUp();
|
|
|
|
}
|
|
|
|
|
|
|
|
void TearDown() override {
|
|
|
|
HardwareParse::TearDown();
|
|
|
|
Parent::TearDown();
|
|
|
|
}
|
|
|
|
|
|
|
|
GenCmdList::iterator itorWalker1;
|
|
|
|
GenCmdList::iterator itorWalker2;
|
|
|
|
};
|
2019-03-26 11:59:46 +01:00
|
|
|
} // namespace NEO
|