mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-31 20:13:04 +08:00
performance: fix minor inefficiencies - leverage move semantics
Related-To: NEO-15630 Signed-off-by: Maciej Bielski <maciej.bielski@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
0de2b26c7c
commit
6005284a6f
@@ -728,6 +728,8 @@ inline ze_result_t ModuleImp::initializeTranslationUnit(const ze_module_desc_t *
|
||||
|
||||
this->createBuildOptions(nullptr, buildOptions, internalBuildOptions);
|
||||
|
||||
inputSpirVs.reserve(programExpDesc->count);
|
||||
inputModuleSizes.reserve(programExpDesc->count);
|
||||
for (uint32_t i = 0; i < static_cast<uint32_t>(programExpDesc->count); i++) {
|
||||
std::string tmpBuildOptions;
|
||||
std::string tmpInternalBuildOptions;
|
||||
@@ -750,11 +752,11 @@ inline ze_result_t ModuleImp::initializeTranslationUnit(const ze_module_desc_t *
|
||||
// If the user passed in only 1 SPIRV, then fallback to standard build
|
||||
if (inputSpirVs.size() > 1) {
|
||||
this->precompiled = false;
|
||||
return this->translationUnit->staticLinkSpirV(inputSpirVs,
|
||||
inputModuleSizes,
|
||||
return this->translationUnit->staticLinkSpirV(std::move(inputSpirVs),
|
||||
std::move(inputModuleSizes),
|
||||
buildOptions.c_str(),
|
||||
internalBuildOptions.c_str(),
|
||||
specConstants);
|
||||
std::move(specConstants));
|
||||
} else {
|
||||
this->precompiled = false;
|
||||
return this->translationUnit->buildFromSpirV(reinterpret_cast<const char *>(programExpDesc->pInputModules[0]),
|
||||
|
||||
@@ -350,7 +350,7 @@ void MclDecoder::parseSymbols() {
|
||||
kernelData.kernelStartOffset = symbol.value;
|
||||
kernelData.kernelStartAddress = program.segments.ih.address + symbol.value;
|
||||
kernelData.kernelIsa = {program.segments.ih.initData.begin() + symbol.value, symbol.size};
|
||||
kernelDataVec.push_back(kernelData);
|
||||
kernelDataVec.push_back(std::move(kernelData));
|
||||
} else if (symbol.section == Sections::SectionType::shtIoh) {
|
||||
auto dispatchId = std::stoi(symbolName.substr(Symbols::SymbolNames::iohPrefix.length()).str());
|
||||
UNRECOVERABLE_IF(static_cast<size_t>(dispatchId) >= dispatchInfos.size());
|
||||
|
||||
Reference in New Issue
Block a user