mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
The MockZebin module is used, which has prepared CopyBuffer kernel, so it does not need to be fetched from a file Related-To: NEO-14058 Signed-off-by: Marcel Skierkowski <marcel.skierkowski@intel.com>
69 lines
1.7 KiB
C++
69 lines
1.7 KiB
C++
/*
|
|
* Copyright (C) 2018-2025 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include <memory>
|
|
#include <string>
|
|
|
|
namespace NEO {
|
|
class Context;
|
|
class ClDeviceVector;
|
|
class MockContext;
|
|
class MockProgram;
|
|
class ClDevice;
|
|
class MockNeoProgram;
|
|
using cl_int = int;
|
|
|
|
class NEOProgramFixture {
|
|
public:
|
|
NEOProgramFixture();
|
|
~NEOProgramFixture();
|
|
|
|
protected:
|
|
void setUp();
|
|
void tearDown();
|
|
std::unique_ptr<MockContext> context;
|
|
std::unique_ptr<MockNeoProgram> program;
|
|
};
|
|
|
|
class ProgramFixture {
|
|
public:
|
|
void createProgramFromBinary(Context *pContext,
|
|
const ClDeviceVector &deviceVector,
|
|
const unsigned char **binary,
|
|
const size_t *binarySize);
|
|
|
|
void createProgramFromBinary(Context *pContext,
|
|
const ClDeviceVector &deviceVector,
|
|
const std::string &binaryFileName,
|
|
cl_int &retVal,
|
|
const std::string &options = "");
|
|
|
|
void createProgramFromBinary(Context *pContext,
|
|
const ClDeviceVector &deviceVector,
|
|
const std::string &binaryFileName,
|
|
const std::string &options = "");
|
|
|
|
void createProgramWithSource(Context *pContext,
|
|
const std::string &sourceFileName);
|
|
|
|
protected:
|
|
void setUp() {
|
|
}
|
|
|
|
void tearDown() {
|
|
cleanup();
|
|
}
|
|
|
|
void cleanup();
|
|
|
|
MockProgram *pProgram = nullptr;
|
|
std::unique_ptr<char[]> knownSource;
|
|
size_t knownSourceSize = 0u;
|
|
};
|
|
} // namespace NEO
|