2018-03-05 16:25:40 +08:00
|
|
|
/*
|
2020-01-14 21:32:11 +08:00
|
|
|
* Copyright (C) 2018-2020 Intel Corporation
|
2018-09-18 15:11:08 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
2018-03-05 16:25:40 +08:00
|
|
|
|
|
|
|
#include "runtime/helpers/built_ins_helper.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-02-07 01:57:00 +08:00
|
|
|
#include "core/device/device.h"
|
2019-10-21 21:47:04 +08:00
|
|
|
#include "runtime/compiler_interface/default_cl_cache_config.h"
|
2019-12-03 22:57:45 +08:00
|
|
|
#include "unit_tests/mocks/mock_builtins.h"
|
2018-03-05 16:25:40 +08:00
|
|
|
#include "unit_tests/mocks/mock_compilers.h"
|
2018-05-14 17:25:18 +08:00
|
|
|
#include "unit_tests/mocks/mock_program.h"
|
2019-12-03 22:57:45 +08:00
|
|
|
#include "unit_tests/mocks/mock_sip.h"
|
2018-03-05 16:25:40 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2018-08-01 15:06:46 +08:00
|
|
|
|
2019-12-03 22:57:45 +08:00
|
|
|
namespace MockSipData {
|
2019-12-17 15:11:16 +08:00
|
|
|
std::unique_ptr<MockSipKernel> mockSipKernel;
|
2019-12-03 22:57:45 +08:00
|
|
|
SipKernelType calledType = SipKernelType::COUNT;
|
|
|
|
bool called = false;
|
|
|
|
} // namespace MockSipData
|
2018-08-01 15:06:46 +08:00
|
|
|
|
2020-01-14 21:32:11 +08:00
|
|
|
const SipKernel &initSipKernel(SipKernelType type, ClDevice &device) {
|
2019-12-03 22:57:45 +08:00
|
|
|
MockSipData::calledType = type;
|
2019-12-17 15:11:16 +08:00
|
|
|
MockSipData::mockSipKernel->type = type;
|
2019-12-03 22:57:45 +08:00
|
|
|
MockSipData::called = true;
|
2019-12-17 15:11:16 +08:00
|
|
|
return *MockSipData::mockSipKernel;
|
2018-03-05 16:25:40 +08:00
|
|
|
}
|
2018-08-14 16:56:42 +08:00
|
|
|
Program *createProgramForSip(ExecutionEnvironment &executionEnvironment,
|
|
|
|
Context *context,
|
2018-05-14 17:25:18 +08:00
|
|
|
std::vector<char> &binary,
|
|
|
|
size_t size,
|
|
|
|
cl_int *errcodeRet) {
|
|
|
|
GlobalMockSipProgram::sipProgram->incRefApi();
|
|
|
|
GlobalMockSipProgram::sipProgram->resetAllocationState();
|
|
|
|
return GlobalMockSipProgram::sipProgram;
|
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|