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-22 16:28:27 +08:00
|
|
|
#include "helpers/built_ins_helper.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2020-02-19 16:14:40 +08:00
|
|
|
#include "core/device/device.h"
|
2020-02-22 16:28:27 +08:00
|
|
|
|
|
|
|
#include "program/program.h"
|
2018-03-05 16:25:40 +08:00
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2020-02-19 16:14:40 +08:00
|
|
|
const SipKernel &initSipKernel(SipKernelType type, Device &device) {
|
|
|
|
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,
|
2020-02-20 15:12:44 +08:00
|
|
|
cl_int *errcodeRet,
|
|
|
|
Device *device) {
|
2018-05-14 17:25:18 +08:00
|
|
|
|
|
|
|
cl_int retVal = 0;
|
2018-08-14 16:56:42 +08:00
|
|
|
auto program = Program::createFromGenBinary(executionEnvironment,
|
2020-02-20 15:12:44 +08:00
|
|
|
context,
|
2018-05-14 17:25:18 +08:00
|
|
|
binary.data(),
|
|
|
|
size,
|
|
|
|
true,
|
2020-02-20 15:12:44 +08:00
|
|
|
&retVal,
|
|
|
|
device);
|
2018-05-14 17:25:18 +08:00
|
|
|
DEBUG_BREAK_IF(retVal != 0);
|
|
|
|
return program;
|
|
|
|
}
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|