2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2019-02-27 18:39:32 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "unit_tests/fixtures/built_in_fixture.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
|
|
|
#include "runtime/built_ins/built_ins.h"
|
|
|
|
#include "runtime/device/device.h"
|
|
|
|
#include "unit_tests/global_environment.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
#include "unit_tests/helpers/kernel_binary_helper.h"
|
|
|
|
#include "unit_tests/helpers/test_files.h"
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
using namespace NEO;
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
BuiltInFixture::BuiltInFixture() : pBuiltIns(nullptr) {
|
|
|
|
}
|
|
|
|
|
|
|
|
void BuiltInFixture::SetUp(Device *pDevice) {
|
|
|
|
// create an instance of the builtins
|
2018-08-22 19:57:21 +08:00
|
|
|
pBuiltIns = pDevice->getExecutionEnvironment()->getBuiltIns();
|
2017-12-21 07:45:38 +08:00
|
|
|
pBuiltIns->setCacheingEnableState(false);
|
|
|
|
|
|
|
|
// set mock compiler to return expected kernel...
|
|
|
|
MockCompilerDebugVars fclDebugVars;
|
|
|
|
MockCompilerDebugVars igcDebugVars;
|
|
|
|
|
2018-04-24 19:06:49 +08:00
|
|
|
retrieveBinaryKernelFilename(fclDebugVars.fileName, KernelBinaryHelper::BUILT_INS + "_", ".bc");
|
|
|
|
retrieveBinaryKernelFilename(igcDebugVars.fileName, KernelBinaryHelper::BUILT_INS + "_", ".gen");
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
gEnvironment->fclPushDebugVars(fclDebugVars);
|
|
|
|
gEnvironment->igcPushDebugVars(igcDebugVars);
|
|
|
|
}
|
|
|
|
|
|
|
|
void BuiltInFixture::TearDown() {
|
|
|
|
gEnvironment->igcPopDebugVars();
|
|
|
|
gEnvironment->fclPopDebugVars();
|
|
|
|
}
|