2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2021-05-17 02:51:16 +08:00
|
|
|
* Copyright (C) 2018-2021 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
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
2021-10-06 19:43:42 +08:00
|
|
|
#include "shared/test/common/helpers/kernel_binary_helper.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2021-01-21 20:10:13 +08:00
|
|
|
#include "shared/test/common/helpers/test_files.h"
|
2021-09-17 23:06:15 +08:00
|
|
|
#include "shared/test/common/libult/global_environment.h"
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
#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;
|
|
|
|
|
2018-04-24 19:06:49 +08:00
|
|
|
retrieveBinaryKernelFilename(fclDebugVars.fileName, name + "_", ".bc");
|
|
|
|
retrieveBinaryKernelFilename(igcDebugVars.fileName, name + "_", ".gen");
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
fclDebugVars.appendOptionsToFileName = appendOptionsToFileName;
|
|
|
|
igcDebugVars.appendOptionsToFileName = appendOptionsToFileName;
|
|
|
|
|
|
|
|
gEnvironment->fclPushDebugVars(fclDebugVars);
|
|
|
|
gEnvironment->igcPushDebugVars(igcDebugVars);
|
|
|
|
}
|
|
|
|
|
|
|
|
KernelBinaryHelper::~KernelBinaryHelper() {
|
|
|
|
gEnvironment->igcPopDebugVars();
|
|
|
|
gEnvironment->fclPopDebugVars();
|
|
|
|
}
|