2018-03-05 16:25:40 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2018-2019 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
|
|
|
|
|
|
|
#include "runtime/execution_environment/execution_environment.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"
|
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
|
|
|
|
2018-03-05 16:25:40 +08:00
|
|
|
const SipKernel &initSipKernel(SipKernelType type, Device &device) {
|
2018-08-01 15:06:46 +08:00
|
|
|
auto mockCompilerInterface = new MockCompilerInterface();
|
|
|
|
mockCompilerInterface->initialize();
|
|
|
|
|
|
|
|
device.getExecutionEnvironment()->compilerInterface.reset(mockCompilerInterface);
|
2018-03-05 16:25:40 +08:00
|
|
|
mockCompilerInterface->sipKernelBinaryOverride = mockCompilerInterface->getDummyGenBinary();
|
2018-08-22 19:57:21 +08:00
|
|
|
return device.getExecutionEnvironment()->getBuiltIns()->getSipKernel(type, device);
|
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
|