Files
compute-runtime/opencl/test/unit_test/fixtures/built_in_fixture.cpp
Maciej Plewka 357fdc2e65 Move built ins to share directory
Change-Id: I740a349a0f15229cd356fffe996932029bf0f98b
Signed-off-by: Maciej Plewka <maciej.plewka@intel.com>
2020-02-24 15:46:44 +01:00

42 lines
1.2 KiB
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/test/unit_test/fixtures/built_in_fixture.h"
#include "shared/source/built_ins/built_ins.h"
#include "shared/source/device/device.h"
#include "opencl/test/unit_test/global_environment.h"
#include "opencl/test/unit_test/helpers/kernel_binary_helper.h"
#include "opencl/test/unit_test/helpers/test_files.h"
using namespace NEO;
BuiltInFixture::BuiltInFixture() : pBuiltIns(nullptr) {
}
void BuiltInFixture::SetUp(Device *pDevice) {
// create an instance of the builtins
pBuiltIns = pDevice->getExecutionEnvironment()->getBuiltIns();
pBuiltIns->setCacheingEnableState(false);
// set mock compiler to return expected kernel...
MockCompilerDebugVars fclDebugVars;
MockCompilerDebugVars igcDebugVars;
retrieveBinaryKernelFilename(fclDebugVars.fileName, KernelBinaryHelper::BUILT_INS + "_", ".bc");
retrieveBinaryKernelFilename(igcDebugVars.fileName, KernelBinaryHelper::BUILT_INS + "_", ".gen");
gEnvironment->fclPushDebugVars(fclDebugVars);
gEnvironment->igcPushDebugVars(igcDebugVars);
}
void BuiltInFixture::TearDown() {
gEnvironment->igcPopDebugVars();
gEnvironment->fclPopDebugVars();
}