2017-12-21 07:45:38 +08:00
|
|
|
/*
|
2018-12-28 00:05:48 +08:00
|
|
|
* Copyright (C) 2017-2019 Intel Corporation
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
2018-09-18 15:11:08 +08:00
|
|
|
* SPDX-License-Identifier: MIT
|
2017-12-21 07:45:38 +08:00
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
#include "offline_compiler/offline_compiler.h"
|
2019-02-27 18:39:32 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
#include <string>
|
|
|
|
|
2019-03-26 18:59:46 +08:00
|
|
|
namespace NEO {
|
2017-12-21 07:45:38 +08:00
|
|
|
|
|
|
|
class MockOfflineCompiler : public OfflineCompiler {
|
|
|
|
public:
|
2018-12-28 00:05:48 +08:00
|
|
|
using OfflineCompiler::deviceName;
|
2019-06-12 04:50:45 +08:00
|
|
|
using OfflineCompiler::fclDeviceCtx;
|
2018-06-18 20:36:23 +08:00
|
|
|
using OfflineCompiler::generateFilePathForIr;
|
|
|
|
using OfflineCompiler::generateOptsSuffix;
|
2018-08-07 17:48:30 +08:00
|
|
|
using OfflineCompiler::igcDeviceCtx;
|
2018-03-07 20:43:29 +08:00
|
|
|
using OfflineCompiler::inputFileLlvm;
|
2018-08-07 17:48:30 +08:00
|
|
|
using OfflineCompiler::inputFileSpirV;
|
2018-06-18 20:36:23 +08:00
|
|
|
using OfflineCompiler::isSpirV;
|
|
|
|
using OfflineCompiler::options;
|
|
|
|
using OfflineCompiler::outputDirectory;
|
2018-03-07 23:14:17 +08:00
|
|
|
using OfflineCompiler::outputFile;
|
2018-08-07 17:48:30 +08:00
|
|
|
using OfflineCompiler::sourceCode;
|
2018-06-18 20:36:23 +08:00
|
|
|
using OfflineCompiler::useLlvmText;
|
|
|
|
using OfflineCompiler::useOptionsSuffix;
|
2018-03-07 20:43:29 +08:00
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
MockOfflineCompiler() : OfflineCompiler() {
|
|
|
|
}
|
|
|
|
|
2019-05-14 22:47:35 +08:00
|
|
|
int initialize(size_t numArgs, const std::vector<std::string> &argv) {
|
2017-12-21 07:45:38 +08:00
|
|
|
return OfflineCompiler::initialize(numArgs, argv);
|
|
|
|
}
|
|
|
|
|
2019-05-14 22:47:35 +08:00
|
|
|
int parseCommandLine(size_t numArgs, const std::vector<std::string> &argv) {
|
2017-12-21 07:45:38 +08:00
|
|
|
return OfflineCompiler::parseCommandLine(numArgs, argv);
|
|
|
|
}
|
|
|
|
|
|
|
|
void parseDebugSettings() {
|
|
|
|
return OfflineCompiler::parseDebugSettings();
|
|
|
|
}
|
|
|
|
|
2018-03-27 22:41:18 +08:00
|
|
|
std::string &getOptions() {
|
|
|
|
return options;
|
|
|
|
}
|
|
|
|
|
2017-12-21 07:45:38 +08:00
|
|
|
std::string &getInternalOptions() {
|
|
|
|
return internalOptions;
|
|
|
|
}
|
|
|
|
|
|
|
|
std::string getStringWithinDelimiters(const std::string &src) {
|
|
|
|
return OfflineCompiler::getStringWithinDelimiters(src);
|
|
|
|
}
|
|
|
|
|
|
|
|
void updateBuildLog(const char *pErrorString, const size_t errorStringSize) {
|
|
|
|
OfflineCompiler::updateBuildLog(pErrorString, errorStringSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
int getHardwareInfo(const char *pDeviceName) {
|
|
|
|
return OfflineCompiler::getHardwareInfo(pDeviceName);
|
|
|
|
}
|
|
|
|
|
|
|
|
void storeBinary(char *&pDst, size_t &dstSize, const void *pSrc, const size_t srcSize) {
|
|
|
|
OfflineCompiler::storeBinary(pDst, dstSize, pSrc, srcSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
void storeGenBinary(const void *pSrc, const size_t srcSize) {
|
|
|
|
OfflineCompiler::storeBinary(genBinary, genBinarySize, pSrc, srcSize);
|
|
|
|
}
|
|
|
|
|
|
|
|
int buildSourceCode() {
|
|
|
|
return OfflineCompiler::buildSourceCode();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool generateElfBinary() {
|
|
|
|
return OfflineCompiler::generateElfBinary();
|
|
|
|
}
|
|
|
|
|
|
|
|
char *getElfBinary() {
|
2018-07-28 04:59:40 +08:00
|
|
|
return elfBinary.data();
|
2017-12-21 07:45:38 +08:00
|
|
|
}
|
|
|
|
|
|
|
|
size_t getElfBinarySize() {
|
|
|
|
return elfBinarySize;
|
|
|
|
}
|
|
|
|
|
|
|
|
char *getGenBinary() {
|
|
|
|
return genBinary;
|
|
|
|
}
|
|
|
|
|
|
|
|
size_t getGenBinarySize() {
|
|
|
|
return genBinarySize;
|
|
|
|
}
|
|
|
|
};
|
2019-03-26 18:59:46 +08:00
|
|
|
} // namespace NEO
|