Files
compute-runtime/opencl/test/unit_test/fixtures/run_kernel_fixture.h
Mateusz Jablonski a5a5c94097 Correct clCreateProgramWithBuiltInKernels
create program for all provided devices
move OCL specific code from shared to opencl

Related-To: NEO-5001
Change-Id: Ic352b4e907ae75426634ae4b3c7048edecaf83e7
Signed-off-by: Mateusz Jablonski <mateusz.jablonski@intel.com>
2020-10-22 19:26:34 +02:00

47 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(
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() {
gEnvironment->igcPopDebugVars();
gEnvironment->fclPopDebugVars();
}
struct RunKernelFixtureFactory {
typedef NEO::CommandStreamFixture CommandStreamFixture;
typedef NEO::CommandQueueHwFixture CommandQueueFixture;
};
} // namespace NEO