2020-01-12 01:25:26 +08:00
|
|
|
/*
|
2022-02-23 19:48:31 +08:00
|
|
|
* Copyright (C) 2020-2022 Intel Corporation
|
2020-01-12 01:25:26 +08:00
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: MIT
|
|
|
|
*
|
|
|
|
*/
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
2022-03-01 01:44:06 +08:00
|
|
|
#include "shared/source/compiler_interface/external_functions.h"
|
2020-02-24 05:44:01 +08:00
|
|
|
#include "shared/source/compiler_interface/linker.h"
|
2020-01-12 01:25:26 +08:00
|
|
|
|
2020-01-26 02:18:48 +08:00
|
|
|
#include <cstddef>
|
2020-01-12 01:25:26 +08:00
|
|
|
#include <memory>
|
2022-02-23 19:48:31 +08:00
|
|
|
#include <unordered_map>
|
2020-01-12 01:25:26 +08:00
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
namespace NEO {
|
|
|
|
struct KernelInfo;
|
|
|
|
|
|
|
|
struct ProgramInfo {
|
|
|
|
ProgramInfo() = default;
|
|
|
|
ProgramInfo(ProgramInfo &&) = default;
|
|
|
|
ProgramInfo &operator=(ProgramInfo &&) = default;
|
2020-01-27 17:10:54 +08:00
|
|
|
ProgramInfo(const ProgramInfo &) = delete;
|
|
|
|
ProgramInfo &operator=(const ProgramInfo &) = delete;
|
2020-01-12 01:25:26 +08:00
|
|
|
~ProgramInfo();
|
|
|
|
|
|
|
|
struct GlobalSurfaceInfo {
|
|
|
|
const void *initData = nullptr;
|
|
|
|
size_t size = 0U;
|
|
|
|
};
|
|
|
|
|
|
|
|
void prepareLinkerInputStorage() {
|
|
|
|
if (this->linkerInput == nullptr) {
|
|
|
|
this->linkerInput = std::make_unique<LinkerInput>();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
GlobalSurfaceInfo globalConstants;
|
|
|
|
GlobalSurfaceInfo globalVariables;
|
2021-11-02 23:29:09 +08:00
|
|
|
GlobalSurfaceInfo globalStrings;
|
2020-01-12 01:25:26 +08:00
|
|
|
std::unique_ptr<LinkerInput> linkerInput;
|
2022-02-23 19:48:31 +08:00
|
|
|
std::unordered_map<std::string, std::string> globalsDeviceToHostNameMap;
|
2020-01-12 01:25:26 +08:00
|
|
|
|
2022-03-01 01:44:06 +08:00
|
|
|
std::vector<ExternalFunctionInfo> externalFunctions;
|
2020-01-12 01:25:26 +08:00
|
|
|
std::vector<KernelInfo *> kernelInfos;
|
2021-07-13 23:29:58 +08:00
|
|
|
uint32_t grfSize = 32U;
|
2022-09-08 19:12:08 +08:00
|
|
|
uint32_t minScratchSpaceSize = 0U;
|
2022-10-12 01:06:26 +08:00
|
|
|
size_t kernelMiscInfoPos = std::string::npos;
|
2020-01-12 01:25:26 +08:00
|
|
|
};
|
|
|
|
|
2020-01-26 02:18:48 +08:00
|
|
|
size_t getMaxInlineSlmNeeded(const ProgramInfo &programInfo);
|
|
|
|
bool requiresLocalMemoryWindowVA(const ProgramInfo &programInfo);
|
2022-09-27 22:19:01 +08:00
|
|
|
bool isRebuiltToPatchtokensRequired(Device *neoDevice, ArrayRef<const uint8_t> archive, std::string &optionsString, bool isBuiltin);
|
2020-01-26 02:18:48 +08:00
|
|
|
|
2022-10-27 23:09:41 +08:00
|
|
|
} // namespace NEO
|