mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-10 12:53:42 +08:00
Mock debug program instead of using binaries
Removes usage of precompiled binaries in debug program tests. Related-To: NEO-7383 Signed-off-by: Krystian Chmielewski <krystian.chmielewski@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
69bef975f0
commit
52b1d92193
49
opencl/test/unit_test/mocks/mock_debug_program.h
Normal file
49
opencl/test/unit_test/mocks/mock_debug_program.h
Normal file
@ -0,0 +1,49 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "opencl/source/program/program.h"
|
||||
|
||||
#include <memory>
|
||||
|
||||
namespace NEO {
|
||||
class ClDevice;
|
||||
class ClDeviceVector;
|
||||
class Device;
|
||||
struct KernelInfo;
|
||||
struct MockCompilerInterfaceCaptureBuildOptions;
|
||||
} // namespace NEO
|
||||
|
||||
class MockDebugProgram : public NEO::Program {
|
||||
public:
|
||||
using Base = NEO::Program;
|
||||
using Base::Base;
|
||||
using Base::buildInfos;
|
||||
using Base::irBinary;
|
||||
using Base::irBinarySize;
|
||||
using Base::kernelDebugEnabled;
|
||||
|
||||
MockDebugProgram(const NEO::ClDeviceVector &deviceVector);
|
||||
|
||||
void debugNotify(const NEO::ClDeviceVector &deviceVector, std::unordered_map<uint32_t, BuildPhase> &phasesReached) override;
|
||||
void createDebugZebin(uint32_t rootDeviceIndex) override;
|
||||
void processDebugData(uint32_t rootDeviceIndex) override;
|
||||
cl_int processGenBinary(const NEO::ClDevice &clDevice) override;
|
||||
|
||||
void addKernelInfo(NEO::KernelInfo *inInfo, uint32_t rootDeviceIndex);
|
||||
|
||||
NEO::KernelInfo *kernelInfo = nullptr;
|
||||
std::unique_ptr<char[]> kernelSsh;
|
||||
NEO::MockCompilerInterfaceCaptureBuildOptions *compilerInterface;
|
||||
bool wasDebuggerNotified = false;
|
||||
bool wasCreateDebugZebinCalled = false;
|
||||
bool wasProcessDebugDataCalled = false;
|
||||
|
||||
protected:
|
||||
void prepareKernelInfo();
|
||||
void prepareSSHForDebugSurface();
|
||||
void prepareMockCompilerInterface(NEO::Device &device);
|
||||
};
|
Reference in New Issue
Block a user