mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Reorganization directory structure [2/n]
Change-Id: I47962d17d755e80dcd9476e1ed75560f433f6115
This commit is contained in:

committed by
Jaroslaw Chodor

parent
d015d3633f
commit
e8852a68c4
58
opencl/test/unit_test/fixtures/program_fixture.h
Normal file
58
opencl/test/unit_test/fixtures/program_fixture.h
Normal file
@ -0,0 +1,58 @@
|
||||
/*
|
||||
* Copyright (C) 2017-2020 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#pragma once
|
||||
#include "core/helpers/file_io.h"
|
||||
#include "opencl/source/program/program.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
#include "helpers/test_files.h"
|
||||
#include "mocks/mock_program.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class ProgramFixture {
|
||||
public:
|
||||
ProgramFixture() : pProgram(nullptr),
|
||||
knownSource(nullptr),
|
||||
knownSourceSize(0) {}
|
||||
|
||||
void CreateProgramFromBinary(cl_context context,
|
||||
cl_device_id *pDeviceList,
|
||||
const std::string &binaryFileName,
|
||||
cl_int &retVal,
|
||||
const std::string &options = "");
|
||||
|
||||
void CreateProgramFromBinary(cl_context pContext,
|
||||
cl_device_id *pDeviceList,
|
||||
const std::string &binaryFileName,
|
||||
const std::string &options = "");
|
||||
|
||||
void CreateProgramWithSource(cl_context pContext,
|
||||
cl_device_id *pDeviceList,
|
||||
const std::string &SourceFileName);
|
||||
|
||||
protected:
|
||||
virtual void SetUp() {
|
||||
}
|
||||
|
||||
virtual void TearDown() {
|
||||
Cleanup();
|
||||
}
|
||||
|
||||
void Cleanup() {
|
||||
if (pProgram != nullptr) {
|
||||
pProgram->release();
|
||||
}
|
||||
knownSource.reset();
|
||||
}
|
||||
|
||||
MockProgram *pProgram;
|
||||
std::unique_ptr<char[]> knownSource;
|
||||
size_t knownSourceSize;
|
||||
};
|
||||
} // namespace NEO
|
Reference in New Issue
Block a user