2017-12-21 00:45:38 +01:00
|
|
|
/*
|
2024-06-10 12:03:50 +00:00
|
|
|
* Copyright (C) 2018-2024 Intel Corporation
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
2018-09-18 09:11:08 +02:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 00:45:38 +01:00
|
|
|
*
|
|
|
|
|
*/
|
|
|
|
|
|
2021-10-06 11:43:42 +00:00
|
|
|
#include "shared/test/common/helpers/kernel_binary_helper.h"
|
2019-02-27 11:39:32 +01:00
|
|
|
|
2021-01-21 13:10:13 +01:00
|
|
|
#include "shared/test/common/helpers/test_files.h"
|
2021-09-17 15:06:15 +00:00
|
|
|
#include "shared/test/common/libult/global_environment.h"
|
2017-12-21 00:45:38 +01: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;
|
|
|
|
|
|
2024-06-11 05:18:41 +02:00
|
|
|
retrieveBinaryKernelFilename(fclDebugVars.fileName, name + "_", ".bc");
|
2022-10-04 18:31:33 +00:00
|
|
|
retrieveBinaryKernelFilename(igcDebugVars.fileName, name + "_", ".bin");
|
2017-12-21 00:45:38 +01:00
|
|
|
|
2022-08-31 19:16:06 +00:00
|
|
|
appendBinaryNameSuffix(fclDebugVars.fileNameSuffix);
|
|
|
|
|
appendBinaryNameSuffix(igcDebugVars.fileNameSuffix);
|
|
|
|
|
|
2017-12-21 00:45:38 +01:00
|
|
|
fclDebugVars.appendOptionsToFileName = appendOptionsToFileName;
|
|
|
|
|
igcDebugVars.appendOptionsToFileName = appendOptionsToFileName;
|
|
|
|
|
|
|
|
|
|
gEnvironment->fclPushDebugVars(fclDebugVars);
|
|
|
|
|
gEnvironment->igcPushDebugVars(igcDebugVars);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
KernelBinaryHelper::~KernelBinaryHelper() {
|
|
|
|
|
gEnvironment->igcPopDebugVars();
|
|
|
|
|
gEnvironment->fclPopDebugVars();
|
|
|
|
|
}
|