Files
compute-runtime/opencl/test/unit_test/helpers/kernel_binary_helper.cpp
Mateusz Hoppe bd247d725b AppendLaunchKernel tests
RelatedTo: NEO-4515

Change-Id: I1f719ea1f60f313fba44d49f84fe2caf6ea4e5c4
Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
2020-04-06 15:46:04 +02:00

37 lines
1.0 KiB
C++

/*
* Copyright (C) 2017-2020 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#include "opencl/test/unit_test/helpers/kernel_binary_helper.h"
#include "shared/test/unit_test/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();
}