2018-03-05 09:25:40 +01:00
|
|
|
/*
|
2021-01-04 11:44:28 +00:00
|
|
|
* Copyright (C) 2018-2021 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
|
*
|
|
|
|
|
*/
|
2018-03-05 09:25:40 +01:00
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
2020-02-24 13:10:44 +01:00
|
|
|
#include "shared/source/built_ins/sip.h"
|
|
|
|
|
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_execution_environment.h"
|
2020-02-22 09:28:27 +01:00
|
|
|
|
2019-12-03 15:57:45 +01:00
|
|
|
#include <memory>
|
2018-03-05 09:25:40 +01:00
|
|
|
#include <vector>
|
2019-12-03 15:57:45 +01:00
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2019-12-03 15:57:45 +01:00
|
|
|
class MemoryAllocation;
|
|
|
|
|
|
2018-03-05 09:25:40 +01:00
|
|
|
class MockSipKernel : public SipKernel {
|
|
|
|
|
public:
|
2019-12-03 15:57:45 +01:00
|
|
|
using SipKernel::type;
|
|
|
|
|
|
2020-12-02 10:22:27 +00:00
|
|
|
MockSipKernel(SipKernelType type, GraphicsAllocation *sipAlloc);
|
2019-12-03 15:57:45 +01:00
|
|
|
MockSipKernel();
|
2020-03-13 09:17:01 +01:00
|
|
|
~MockSipKernel() override;
|
2019-12-03 15:57:45 +01:00
|
|
|
|
2021-01-04 11:44:28 +00:00
|
|
|
static const char *dummyBinaryForSip;
|
2018-03-05 09:25:40 +01:00
|
|
|
static std::vector<char> getDummyGenBinary();
|
2019-12-03 15:57:45 +01:00
|
|
|
|
|
|
|
|
GraphicsAllocation *getSipAllocation() const override;
|
2021-03-30 19:31:58 -07:00
|
|
|
const std::vector<char> &getStateSaveAreaHeader() const override;
|
2019-12-03 15:57:45 +01:00
|
|
|
|
2021-04-16 12:52:30 +00:00
|
|
|
void createMockSipAllocation();
|
|
|
|
|
|
2019-12-03 15:57:45 +01:00
|
|
|
std::unique_ptr<MemoryAllocation> mockSipMemoryAllocation;
|
2021-05-03 16:53:05 -07:00
|
|
|
std::vector<char> mockStateSaveAreaHeader = {'s', 's', 'a', 'h'};
|
2019-12-17 08:11:16 +01:00
|
|
|
MockExecutionEnvironment executionEnvironment;
|
2018-03-05 09:25:40 +01:00
|
|
|
};
|
2020-12-02 10:22:27 +00:00
|
|
|
|
|
|
|
|
namespace MockSipData {
|
|
|
|
|
extern std::unique_ptr<MockSipKernel> mockSipKernel;
|
|
|
|
|
extern SipKernelType calledType;
|
|
|
|
|
extern bool called;
|
2021-04-16 12:52:30 +00:00
|
|
|
extern bool returned;
|
|
|
|
|
extern bool useMockSip;
|
|
|
|
|
|
|
|
|
|
void clearUseFlags();
|
2020-12-02 10:22:27 +00:00
|
|
|
} // namespace MockSipData
|
2019-12-17 08:11:16 +01:00
|
|
|
} // namespace NEO
|