mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00

RelatedTo: NEO-4515 Change-Id: I1f719ea1f60f313fba44d49f84fe2caf6ea4e5c4 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
48 lines
1.3 KiB
C++
48 lines
1.3 KiB
C++
/*
|
|
* Copyright (C) 2017-2020 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
|
|
#include "shared/test/unit_test/helpers/test_files.h"
|
|
|
|
#include "opencl/test/unit_test/global_environment.h"
|
|
|
|
namespace NEO {
|
|
struct CommandQueueHwFixture;
|
|
struct CommandStreamFixture;
|
|
|
|
// helper functions to enforce MockCompiler input files
|
|
inline void overwriteBuiltInBinaryName(
|
|
Device *pDevice,
|
|
const std::string &filename,
|
|
bool appendOptionsToFileName = false) {
|
|
// set mock compiler to return expected kernel...
|
|
MockCompilerDebugVars fclDebugVars;
|
|
MockCompilerDebugVars igcDebugVars;
|
|
|
|
retrieveBinaryKernelFilename(fclDebugVars.fileName, filename + "_", ".bc");
|
|
fclDebugVars.appendOptionsToFileName = appendOptionsToFileName;
|
|
|
|
retrieveBinaryKernelFilename(igcDebugVars.fileName, filename + "_", ".gen");
|
|
igcDebugVars.appendOptionsToFileName = appendOptionsToFileName;
|
|
|
|
gEnvironment->fclPushDebugVars(fclDebugVars);
|
|
gEnvironment->igcPushDebugVars(igcDebugVars);
|
|
}
|
|
|
|
inline void restoreBuiltInBinaryName(Device *pDevice) {
|
|
gEnvironment->igcPopDebugVars();
|
|
gEnvironment->fclPopDebugVars();
|
|
}
|
|
|
|
struct RunKernelFixtureFactory {
|
|
typedef NEO::CommandStreamFixture CommandStreamFixture;
|
|
typedef NEO::CommandQueueHwFixture CommandQueueFixture;
|
|
};
|
|
|
|
} // namespace NEO
|