Files
compute-runtime/opencl/test/unit_test/fixtures/program_fixture.h
Artur Harasimiuk e9be9b64c6 clang-tidy configuration cleanup
Define single .clang-tidy configuration with all used checks and use
NOLINT to selectively silence tool. That way cleanup should be easier.
third_part/ has its own configuration that disables clang-tidy for this
folder.

Signed-off-by: Artur Harasimiuk <artur.harasimiuk@intel.com>
2022-05-11 14:02:04 +02:00

55 lines
1.6 KiB
C++

/*
* Copyright (C) 2018-2022 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "shared/source/helpers/file_io.h"
#include "shared/test/common/helpers/test_files.h"
#include "opencl/source/program/program.h"
#include "opencl/test/unit_test/mocks/mock_program.h"
#include "gtest/gtest.h"
namespace NEO {
class ProgramFixture {
public:
void CreateProgramFromBinary(Context *pContext, // NOLINT(readability-identifier-naming)
const ClDeviceVector &deviceVector,
const std::string &binaryFileName,
cl_int &retVal,
const std::string &options = "");
void CreateProgramFromBinary(Context *pContext, // NOLINT(readability-identifier-naming)
const ClDeviceVector &deviceVector,
const std::string &binaryFileName,
const std::string &options = "");
void CreateProgramWithSource(Context *pContext, // NOLINT(readability-identifier-naming)
const std::string &sourceFileName);
protected:
virtual void SetUp() { // NOLINT(readability-identifier-naming)
}
virtual void TearDown() { // NOLINT(readability-identifier-naming)
Cleanup();
}
void Cleanup() { // NOLINT(readability-identifier-naming)
if (pProgram != nullptr) {
pProgram->release();
}
knownSource.reset();
}
MockProgram *pProgram = nullptr;
std::unique_ptr<char[]> knownSource;
size_t knownSourceSize = 0u;
};
} // namespace NEO