Files
compute-runtime/opencl/test/unit_test/fixtures/built_in_fixture.cpp
Filip Hazubski 6c4b1f951c Do not force cl_khr_3d_image_writes extension when compiling kernels
Update usage of SUPPORTED_IMAGES flag and do not use images when disabled.
Use SUPPORTED_2_0 only on fully OCL 2.1 conformant platforms.

Signed-off-by: Filip Hazubski <filip.hazubski@intel.com>
2020-11-27 17:20:46 +01:00

46 lines
1.4 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 "shared/test/unit_test/helpers/test_files.h"
#include "shared/test/unit_test/test_macros/test_checks_shared.h"
#include "opencl/test/unit_test/global_environment.h"
#include "opencl/test/unit_test/helpers/kernel_binary_helper.h"
using namespace NEO;
void BuiltInFixture::SetUp(Device *pDevice) {
// create an instance of the builtins
pBuiltIns = pDevice->getBuiltIns();
pBuiltIns->setCacheingEnableState(false);
// set mock compiler to return expected kernel...
MockCompilerDebugVars fclDebugVars;
MockCompilerDebugVars igcDebugVars;
std::string builtInsFileName;
if (TestChecks::supportsImages(pDevice->getHardwareInfo())) {
builtInsFileName = KernelBinaryHelper::BUILT_INS_WITH_IMAGES;
} else {
builtInsFileName = KernelBinaryHelper::BUILT_INS;
}
retrieveBinaryKernelFilename(fclDebugVars.fileName, builtInsFileName + "_", ".bc");
retrieveBinaryKernelFilename(igcDebugVars.fileName, builtInsFileName + "_", ".gen");
gEnvironment->fclPushDebugVars(fclDebugVars);
gEnvironment->igcPushDebugVars(igcDebugVars);
}
void BuiltInFixture::TearDown() {
gEnvironment->igcPopDebugVars();
gEnvironment->fclPopDebugVars();
}