Files
compute-runtime/unit_tests/offline_compiler/decoder/mock/mock_decoder.h
Chodor, Jaroslaw 2f42f332d8 Adding support for kernel disasm using IGA
Change-Id: Ic75540c9b42913f5d12d66438cc4e6dcc39ceb98
2019-06-28 12:18:20 +02:00

40 lines
1.1 KiB
C++

/*
* Copyright (C) 2018-2019 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
*/
#pragma once
#include "offline_compiler/decoder/binary_decoder.h"
#include "mock_iga_wrapper.h"
struct MockDecoder : public BinaryDecoder {
MockDecoder() : MockDecoder("", "", "") {
}
MockDecoder(const std::string &file, const std::string &patch, const std::string &dump)
: BinaryDecoder(file, patch, dump) {
this->iga.reset(new MockIgaWrapper);
setMessagePrinter(MessagePrinter{true});
};
using BinaryDecoder::binaryFile;
using BinaryDecoder::decode;
using BinaryDecoder::getSize;
using BinaryDecoder::iga;
using BinaryDecoder::kernelHeader;
using BinaryDecoder::parseTokens;
using BinaryDecoder::patchTokens;
using BinaryDecoder::pathToDump;
using BinaryDecoder::pathToPatch;
using BinaryDecoder::processBinary;
using BinaryDecoder::processKernel;
using BinaryDecoder::programHeader;
using BinaryDecoder::readPatchTokens;
using BinaryDecoder::readStructFields;
MockIgaWrapper *getMockIga() const {
return static_cast<MockIgaWrapper *>(iga.get());
}
};