mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-28 08:37:12 +08:00
This commit adds debug zebin creation in OCL. - Added returning debug zebin in build/linking paths in OCL if corresponding device binary format was detected. - Refactored getZebinSegments() method - added common ctor for both L0/OCL paths Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
54 lines
1.7 KiB
C++
54 lines
1.7 KiB
C++
/*
|
|
* Copyright (C) 2022 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#pragma once
|
|
#include "opencl/test/unit_test/mocks/mock_program.h"
|
|
#include "opencl/test/unit_test/program/program_tests.h"
|
|
|
|
using namespace NEO;
|
|
|
|
class MockBuffer;
|
|
class ProgramWithZebinFixture : public ProgramTests {
|
|
public:
|
|
std::unique_ptr<MockProgram> program;
|
|
std::unique_ptr<KernelInfo> kernelInfo;
|
|
std::unique_ptr<MockGraphicsAllocation> mockAlloc;
|
|
std::unique_ptr<MockBuffer> globalSurface;
|
|
std::unique_ptr<MockBuffer> constantSurface;
|
|
const char strings[12] = "Hello olleH";
|
|
const char kernelName[8] = "kernel1";
|
|
void SetUp() override;
|
|
void TearDown() override;
|
|
void addEmptyZebin(MockProgram *program);
|
|
void populateProgramWithSegments(MockProgram *program);
|
|
~ProgramWithZebinFixture() = default;
|
|
};
|
|
|
|
class ProgramWithDebugDataCreationFixture : public ProgramWithZebinFixture {
|
|
|
|
class MockProgramWithDebugDataCreation : public MockProgram {
|
|
public:
|
|
using Program::createDebugData;
|
|
MockProgramWithDebugDataCreation(const ClDeviceVector &deviceVector) : MockProgram(deviceVector) {
|
|
}
|
|
~MockProgramWithDebugDataCreation() {
|
|
}
|
|
bool wasProcessDebugDataCalled = false;
|
|
void processDebugData(uint32_t rootDeviceIndex) override {
|
|
wasProcessDebugDataCalled = true;
|
|
}
|
|
bool wasCreateDebugZebinCalled = false;
|
|
void createDebugZebin(uint32_t rootDeviceIndex) override {
|
|
wasCreateDebugZebinCalled = true;
|
|
}
|
|
};
|
|
|
|
public:
|
|
std::unique_ptr<MockProgramWithDebugDataCreation> programWithDebugDataCreation;
|
|
void SetUp() override;
|
|
void TearDown() override;
|
|
}; |