2018-12-06 15:33:02 +01:00
|
|
|
/*
|
2022-06-07 09:30:54 +00:00
|
|
|
* Copyright (C) 2019-2022 Intel Corporation
|
2018-12-06 15:33:02 +01:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2022-06-07 09:30:54 +00:00
|
|
|
#pragma once
|
|
|
|
|
2020-02-24 13:10:44 +01:00
|
|
|
#include "shared/source/built_ins/built_ins.h"
|
2020-10-07 14:22:26 +02:00
|
|
|
#include "shared/source/command_container/command_encoder.h"
|
2021-01-21 13:10:13 +01:00
|
|
|
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
2020-02-24 13:10:44 +01:00
|
|
|
|
2020-02-22 22:50:57 +01:00
|
|
|
#include "opencl/source/helpers/hardware_commands_helper.h"
|
|
|
|
#include "opencl/source/kernel/kernel.h"
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/fixtures/built_in_fixture.h"
|
2020-05-28 14:05:12 +02:00
|
|
|
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_context.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_program.h"
|
2018-12-06 15:33:02 +01:00
|
|
|
|
|
|
|
#include <memory>
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
using namespace NEO;
|
2018-12-06 15:33:02 +01:00
|
|
|
|
2020-05-28 14:05:12 +02:00
|
|
|
struct HardwareCommandsTest : ClDeviceFixture,
|
2019-06-12 09:13:06 +02:00
|
|
|
ContextFixture,
|
|
|
|
BuiltInFixture,
|
|
|
|
::testing::Test {
|
2018-12-06 15:33:02 +01:00
|
|
|
|
|
|
|
using BuiltInFixture::SetUp;
|
|
|
|
using ContextFixture::SetUp;
|
|
|
|
|
|
|
|
void SetUp() override;
|
|
|
|
void TearDown() override;
|
|
|
|
|
|
|
|
void addSpaceForSingleKernelArg();
|
|
|
|
|
|
|
|
size_t sizeRequiredCS;
|
|
|
|
size_t sizeRequiredISH;
|
|
|
|
|
|
|
|
std::unique_ptr<MockKernelWithInternals> mockKernelWithInternal;
|
|
|
|
Kernel::SimpleKernelArgInfo kernelArgInfo = {};
|
|
|
|
std::vector<Kernel::SimpleKernelArgInfo> kernelArguments;
|
2020-01-23 15:52:49 +01:00
|
|
|
|
|
|
|
template <typename GfxFamily>
|
|
|
|
size_t pushBindingTableAndSurfaceStates(IndirectHeap &dstHeap, const Kernel &srcKernel) {
|
2021-03-22 15:26:03 +00:00
|
|
|
return EncodeSurfaceState<GfxFamily>::pushBindingTableAndSurfaceStates(dstHeap, srcKernel.getKernelInfo().kernelDescriptor.payloadMappings.bindingTable.numEntries,
|
|
|
|
srcKernel.getSurfaceStateHeap(), srcKernel.getSurfaceStateHeapSize(),
|
2021-03-22 11:06:23 +00:00
|
|
|
srcKernel.getNumberOfBindingTableStates(), srcKernel.getBindingTableOffset());
|
2020-01-23 15:52:49 +01:00
|
|
|
}
|
2018-12-06 15:33:02 +01:00
|
|
|
};
|