From 8a8f11369e769c580545637445d36edca2ddb268 Mon Sep 17 00:00:00 2001 From: foreman Date: Mon, 22 Oct 2018 16:46:17 -0400 Subject: [PATCH] P4 to Git Change 1622391 by gandryey@gera-w8 on 2018/10/22 16:33:17 SWDEV-79445 - OCL generic changes and code clean-up - Remove detection of the global memory usage, based on the names of variables Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palprogram.cpp#82 edit --- rocclr/runtime/device/pal/palprogram.cpp | 37 ------------------------ 1 file changed, 37 deletions(-) diff --git a/rocclr/runtime/device/pal/palprogram.cpp b/rocclr/runtime/device/pal/palprogram.cpp index f0c28ddc1d..7183080e68 100644 --- a/rocclr/runtime/device/pal/palprogram.cpp +++ b/rocclr/runtime/device/pal/palprogram.cpp @@ -575,34 +575,6 @@ static hsa_status_t GetKernelNamesCallback(hsa_executable_t hExec, hsa_executabl return HSA_STATUS_SUCCESS; } -static hsa_status_t GetGlobalVarNamesCallback( - hsa_executable_t hExec, hsa_executable_symbol_t hSymbol, - void* data) { - auto symbol = Symbol::Object(hSymbol); - auto symbolNameList = reinterpret_cast*>(data); - - hsa_symbol_kind_t type; - if (!symbol->GetInfo(HSA_CODE_SYMBOL_INFO_TYPE, &type)) { - return HSA_STATUS_ERROR; - } - - if (type == HSA_SYMBOL_KIND_VARIABLE) { - // VariableSymbol* vsym = symbol; // Casting to the variable structure - uint32_t length; - if (!symbol->GetInfo(HSA_EXECUTABLE_SYMBOL_INFO_NAME_LENGTH, &length)) { - return HSA_STATUS_ERROR; - } - - char* name = reinterpret_cast(alloca(length + 1)); - if (!symbol->GetInfo(HSA_EXECUTABLE_SYMBOL_INFO_NAME, name)) { - return HSA_STATUS_ERROR; - } - name[length] = '\0'; - - symbolNameList->push_back(std::string(name)); - } - return HSA_STATUS_SUCCESS; -} #endif // defined(WITH_LIGHTNING_COMPILER) bool LightningProgram::createBinary(amd::option::Options* options) { @@ -681,15 +653,6 @@ bool LightningProgram::setKernels(amd::option::Options* options, void* binary, s std::max(static_cast(kernel->workGroupInfo()->scratchRegs_), maxScratchRegs_); } - // Get the list of global variables - std::vector glbVarNames; - status = executable_->IterateSymbols(GetGlobalVarNamesCallback, &glbVarNames); - if (status != HSA_STATUS_SUCCESS) { - buildLog_ += "Error: Failed to get kernel names\n"; - return false; - } - hasGlobalStores_ = (glbVarNames.size() != 0) ? true : false; - DestroySegmentCpuAccess(); #endif // defined(WITH_LIGHTNING_COMPILER) return true;