Files
compute-runtime/opencl/test/unit_test/helpers/kernel_binary_helper.cpp
lgotszal 3bd4bca911 Copyright header update
Dates corrected in copyright headers to reflect original publication date
(2018 for OpenCL, 2020 for Level Zero).

Signed-off-by: lgotszal <lukasz.gotszald@intel.com>
2021-05-17 20:38:19 +02:00

37 lines
1.0 KiB
C++

/*
* Copyright (C) 2018-2021 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/test/unit_test/helpers/kernel_binary_helper.h"
#include "shared/test/common/helpers/test_files.h"
#include "opencl/test/unit_test/global_environment.h"
#include <string>
extern PRODUCT_FAMILY productFamily;
KernelBinaryHelper::KernelBinaryHelper(const std::string &name, bool appendOptionsToFileName) {
// set mock compiler to return expected kernel
MockCompilerDebugVars fclDebugVars;
MockCompilerDebugVars igcDebugVars;
retrieveBinaryKernelFilename(fclDebugVars.fileName, name + "_", ".bc");
retrieveBinaryKernelFilename(igcDebugVars.fileName, name + "_", ".gen");
fclDebugVars.appendOptionsToFileName = appendOptionsToFileName;
igcDebugVars.appendOptionsToFileName = appendOptionsToFileName;
gEnvironment->fclPushDebugVars(fclDebugVars);
gEnvironment->igcPushDebugVars(igcDebugVars);
}
KernelBinaryHelper::~KernelBinaryHelper() {
gEnvironment->igcPopDebugVars();
gEnvironment->fclPopDebugVars();
}