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
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/helpers/built_ins_helper.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/device/device.h"
|
2020-02-24 17:22:30 +08:00
|
|
|
|
2020-02-23 05:50:57 +08:00
|
|
|
#include "opencl/source/compiler_interface/default_cl_cache_config.h"
|
2020-02-23 22:20:22 +08:00
|
|
|
#include "opencl/test/unit_test/mocks/mock_builtins.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_compilers.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_program.h"
|
|
|
|
#include "opencl/test/unit_test/mocks/mock_sip.h"
|
2020-02-22 16:28:27 +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-02-19 16:14:40 +08:00
|
|
|
const SipKernel &initSipKernel(SipKernelType type, Device &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,
|
2020-02-20 15:12:44 +08:00
|
|
|
cl_int *errcodeRet,
|
|
|
|
Device *device) {
|
2018-05-14 17:25:18 +08:00
|
|
|
GlobalMockSipProgram::sipProgram->incRefApi();
|
|
|
|
GlobalMockSipProgram::sipProgram->resetAllocationState();
|
|
|
|
return GlobalMockSipProgram::sipProgram;
|
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|