P4 to Git Change 1191702 by gandryey@gera-dev-w7 on 2015/09/17 11:42:51
ECR #304775 - Remove EG/NI support - Remove buildNoOpt() method Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#67 edit ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.hpp#32 edit
This commit is contained in:
@@ -526,92 +526,6 @@ Program::build(
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool
|
||||
Program::buildNoOpt(const Device& device, const std::string& kernelName)
|
||||
{
|
||||
ScopedLock sl(buildLock_);
|
||||
// Don't allow multiple builds of program without optimizations
|
||||
if (!firstBuildNoOpt_) {
|
||||
return false;
|
||||
}
|
||||
firstBuildNoOpt_ = false;
|
||||
|
||||
symbols_t::const_iterator it = symbolTable_->find(kernelName);
|
||||
assert((it != symbolTable_->end()) && "Kernel must be valid at this time");
|
||||
const Symbol& progSymbol = it->second;
|
||||
|
||||
// Check if program already has unoptimized kernel
|
||||
device::Kernel* devKernel = const_cast<device::Kernel*>
|
||||
(progSymbol.getDeviceKernel(device, false));
|
||||
if (devKernel != NULL) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// Find the original program for build options string
|
||||
deviceprograms_t::const_iterator pit = devicePrograms_.find(&device);
|
||||
assert((pit != devicePrograms_.end()) && "Program must be valid at this time");
|
||||
device::Program* orgProgram = pit->second;
|
||||
|
||||
// Process build options.
|
||||
option::Options parsedOptions;
|
||||
std::string cppstr(orgProgram->compileOptions());
|
||||
if (AMD_OCL_BUILD_OPTIONS != NULL) {
|
||||
// Override options.
|
||||
cppstr = AMD_OCL_BUILD_OPTIONS;
|
||||
}
|
||||
if (!Device::appProfile()->GetBuildOptsAppend().empty()) {
|
||||
cppstr.append(" ");
|
||||
cppstr.append(Device::appProfile()->GetBuildOptsAppend());
|
||||
}
|
||||
if (AMD_OCL_BUILD_OPTIONS_APPEND != NULL) {
|
||||
cppstr.append(" ");
|
||||
cppstr.append(AMD_OCL_BUILD_OPTIONS_APPEND);
|
||||
}
|
||||
|
||||
if (!option::parseAllOptions(cppstr, parsedOptions)) {
|
||||
return false;
|
||||
}
|
||||
parsedOptions.optionsLog();
|
||||
|
||||
parsedOptions.oVariables->AssumeAlias = true;
|
||||
parsedOptions.oVariables->ForceLLVM = true;
|
||||
|
||||
// Find the program without optimizaiton
|
||||
pit = devProgramsNoOpt_.find(&device);
|
||||
|
||||
// Update the symbol table
|
||||
if (pit != devProgramsNoOpt_.end()) {
|
||||
device::Program& program = *pit->second;
|
||||
const device::Program::binary_t& progBinary = orgProgram->binary();
|
||||
|
||||
if (!program.setBinary(reinterpret_cast<char *>(const_cast<void*>
|
||||
(progBinary.first)), progBinary.second)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Force recompilation from the binary only
|
||||
if (CL_SUCCESS != program.build("", orgProgram->compileOptions().c_str(),
|
||||
&parsedOptions)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
const device::Program::kernels_t& kernels = program.kernels();
|
||||
device::Program::kernels_t::const_iterator kit;
|
||||
for (kit = kernels.begin(); kit != kernels.end(); ++kit) {
|
||||
const std::string& name = kit->first;
|
||||
const device::Kernel* devKernel = kit->second;
|
||||
|
||||
symbols_t::iterator sit = symbolTable_->find(name);
|
||||
Symbol& symbol = sit->second;
|
||||
if (!symbol.setDeviceKernel(device, devKernel, false)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
void
|
||||
Program::clear()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user