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