Files
compute-runtime/shared/test/common/mocks/mock_sip.h
Mateusz Jablonski 98bf872fdd fix: return error when cannot obtain debug surface size
remove default max debug surface size
check state save area size only for debug scenarios
reduce state save area size in unit tests - rely on values from mock

Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2025-05-23 14:48:08 +02:00

58 lines
1.6 KiB
C++

/*
* Copyright (C) 2018-2025 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/built_ins/sip.h"
#include "shared/test/common/mocks/mock_execution_environment.h"
#include <memory>
#include <vector>
namespace NEO {
class MemoryAllocation;
class MockSipKernel : public SipKernel {
public:
using SipKernel::createHeaderFilename;
using SipKernel::type;
MockSipKernel(SipKernelType type, GraphicsAllocation *sipAlloc);
MockSipKernel();
~MockSipKernel() override;
static const char *dummyBinaryForSip;
static std::vector<char> getDummyGenBinary();
GraphicsAllocation *getSipAllocation() const override;
const std::vector<char> &getStateSaveAreaHeader() const override;
void createMockSipAllocation();
void createTempSipAllocation(size_t osContextCount);
std::unique_ptr<MemoryAllocation> mockSipMemoryAllocation;
std::unique_ptr<MemoryAllocation> tempSipMemoryAllocation;
std::vector<char> mockStateSaveAreaHeader;
MockExecutionEnvironment executionEnvironment;
};
namespace MockSipData {
extern std::unique_ptr<MockSipKernel> mockSipKernel;
extern SipKernelType calledType;
extern bool called;
extern bool returned;
extern bool useMockSip;
extern bool uninitializedSipRequested;
extern uint64_t totalWmtpDataSize;
void clearUseFlags();
std::vector<char> createStateSaveAreaHeader(uint32_t version);
std::vector<char> createStateSaveAreaHeader(uint32_t version, uint16_t grfNum);
std::vector<char> createStateSaveAreaHeader(uint32_t version, uint16_t grfNum, uint16_t mmeNum);
} // namespace MockSipData
} // namespace NEO