2018-03-05 09:25:40 +01:00
|
|
|
/*
|
2020-01-30 09:36:05 +01:00
|
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
2018-09-18 09:11:08 +02:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-03-05 09:25:40 +01:00
|
|
|
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_sip.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2020-02-23 22:44:01 +01:00
|
|
|
#include "shared/source/helpers/file_io.h"
|
|
|
|
#include "shared/source/helpers/hw_info.h"
|
2020-11-02 15:54:01 +01:00
|
|
|
#include "shared/source/memory_manager/os_agnostic_memory_manager.h"
|
2020-04-03 23:05:30 +02:00
|
|
|
#include "shared/test/unit_test/helpers/test_files.h"
|
2020-02-24 10:22:30 +01:00
|
|
|
|
2020-02-22 22:50:57 +01:00
|
|
|
#include "opencl/source/os_interface/os_inc_base.h"
|
2020-02-23 15:20:22 +01:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_compilers.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_program.h"
|
2018-03-05 09:25:40 +01:00
|
|
|
|
2019-02-27 11:39:32 +01:00
|
|
|
#include "cif/macros/enable.h"
|
2018-03-05 09:25:40 +01:00
|
|
|
#include "ocl_igc_interface/igc_ocl_device_ctx.h"
|
|
|
|
|
|
|
|
#include <fstream>
|
|
|
|
#include <map>
|
|
|
|
|
2019-03-26 11:59:46 +01:00
|
|
|
namespace NEO {
|
2020-12-02 10:22:27 +00:00
|
|
|
MockSipKernel::MockSipKernel(SipKernelType type, GraphicsAllocation *sipAlloc) : SipKernel(type, sipAlloc) {
|
2019-12-03 15:57:45 +01:00
|
|
|
this->mockSipMemoryAllocation =
|
|
|
|
std::make_unique<MemoryAllocation>(0u,
|
2020-11-30 15:33:56 +00:00
|
|
|
GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL,
|
2019-12-03 15:57:45 +01:00
|
|
|
nullptr,
|
|
|
|
MemoryConstants::pageSize * 10u,
|
|
|
|
0u,
|
|
|
|
MemoryConstants::pageSize,
|
2020-08-20 13:48:47 +02:00
|
|
|
MemoryPool::System4KBPages, 3u);
|
2019-12-03 15:57:45 +01:00
|
|
|
}
|
|
|
|
|
2020-12-02 10:22:27 +00:00
|
|
|
MockSipKernel::MockSipKernel() : SipKernel(SipKernelType::Csr, nullptr) {
|
2019-12-03 15:57:45 +01:00
|
|
|
this->mockSipMemoryAllocation =
|
|
|
|
std::make_unique<MemoryAllocation>(0u,
|
2020-11-30 15:33:56 +00:00
|
|
|
GraphicsAllocation::AllocationType::KERNEL_ISA_INTERNAL,
|
2019-12-03 15:57:45 +01:00
|
|
|
nullptr,
|
|
|
|
MemoryConstants::pageSize * 10u,
|
|
|
|
0u,
|
|
|
|
MemoryConstants::pageSize,
|
2020-08-20 13:48:47 +02:00
|
|
|
MemoryPool::System4KBPages, 3u);
|
2019-12-03 15:57:45 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
MockSipKernel::~MockSipKernel() = default;
|
|
|
|
|
2020-11-30 15:33:56 +00:00
|
|
|
const char *MockSipKernel::dummyBinaryForSip = "12345678";
|
2019-02-15 11:01:40 -08:00
|
|
|
|
2020-11-30 15:33:56 +00:00
|
|
|
std::vector<char> MockSipKernel::getDummyGenBinary() {
|
|
|
|
return std::vector<char>(dummyBinaryForSip, dummyBinaryForSip + sizeof(MockSipKernel::dummyBinaryForSip));
|
2018-03-05 09:25:40 +01:00
|
|
|
}
|
2019-12-03 15:57:45 +01:00
|
|
|
|
|
|
|
GraphicsAllocation *MockSipKernel::getSipAllocation() const {
|
|
|
|
return mockSipMemoryAllocation.get();
|
|
|
|
}
|
2019-12-17 08:11:16 +01:00
|
|
|
} // namespace NEO
|