P4 to Git Change 1990620 by gandryey@gera-win10 on 2019/08/28 18:04:54

SWDEV-200422 - Teamcity built OpenCL ignores all options from LC backend
	- Disable default arguments for ParseAllOptions() to avoid incorrect values

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/gpu/gpudevice.cpp#609 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#104 edit
... //depot/stg/opencl/drivers/opencl/runtime/platform/program.hpp#48 edit
This commit is contained in:
foreman
2019-08-28 18:09:33 -04:00
förälder c875e5bbf2
incheckning cb4e7b6be6
3 ändrade filer med 32 tillägg och 21 borttagningar
+4 -1
Visa fil
@@ -252,7 +252,10 @@ bool NullDevice::isHsailProgram(amd::option::Options* options) {
isInputOptions = true;
}
amd::option::Options parsedOptions;
if (!amd::Program::ParseAllOptions("", parsedOptions)) {
constexpr bool OptionChangable = true;
constexpr bool LinkOptsOnly = false;
constexpr bool IsLC = false;
if (!amd::Program::ParseAllOptions("", parsedOptions, OptionChangable, LinkOptsOnly, IsLC)) {
return NULL;
}
optvec.push_back(&parsedOptions);
+27 -19
Visa fil
@@ -155,7 +155,8 @@ cl_int Program::addDeviceProgram(Device& device, const void* image, size_t lengt
// load the compiler options from the binary if it is not provided
std::string sBinOptions = program->compileOptions();
if (!sBinOptions.empty() && emptyOptions) {
if (!amd::option::parseAllOptions(sBinOptions, *options, false, isLC())) {
if (!amd::option::parseAllOptions(sBinOptions, *options, false,
device.settings().useLightning_)) {
programLog_ = options->optionsLog();
LogError("Parsing compilation options from binary failed.");
return CL_INVALID_COMPILER_OPTIONS;
@@ -205,12 +206,6 @@ cl_int Program::compile(const std::vector<Device*>& devices, size_t numHeaders,
}
remove_g_option(cppstr);
}
option::Options parsedOptions;
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable)) {
programLog_ = parsedOptions.optionsLog();
LogError("Parsing compile options failed.");
return CL_INVALID_COMPILER_OPTIONS;
}
std::vector<const std::string*> headers(numHeaders);
for (size_t i = 0; i < numHeaders; ++i) {
@@ -220,6 +215,14 @@ cl_int Program::compile(const std::vector<Device*>& devices, size_t numHeaders,
// Compile the program programs associated with the given devices.
for (const auto& it : devices) {
option::Options parsedOptions;
constexpr bool LinkOptsOnly = false;
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable, LinkOptsOnly,
it->settings().useLightning_)) {
programLog_ = parsedOptions.optionsLog();
LogError("Parsing compile options failed.");
return CL_INVALID_COMPILER_OPTIONS;
}
device::Program* devProgram = getDeviceProgram(*it);
if (devProgram == NULL) {
const binary_t& bin = binary(*it);
@@ -290,15 +293,17 @@ cl_int Program::link(const std::vector<Device*>& devices, size_t numInputs,
}
remove_g_option(cppstr);
}
option::Options parsedOptions;
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable, true)) {
programLog_ = parsedOptions.optionsLog();
LogError("Parsing link options failed.");
return CL_INVALID_LINKER_OPTIONS;
}
// Link the program programs associated with the given devices.
for (const auto& it : devices) {
option::Options parsedOptions;
constexpr bool LinkOptsOnly = true;
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable, LinkOptsOnly,
it->settings().useLightning_)) {
programLog_ = parsedOptions.optionsLog();
LogError("Parsing link options failed.");
return CL_INVALID_LINKER_OPTIONS;
}
// find the corresponding device program in each input program
std::vector<device::Program*> inputDevPrograms(numInputs);
bool found = false;
@@ -482,15 +487,18 @@ cl_int Program::build(const std::vector<Device*>& devices, const char* options,
}
remove_g_option(cppstr);
}
option::Options parsedOptions;
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable)) {
programLog_ = parsedOptions.optionsLog();
LogError("Parsing compile options failed.");
return CL_INVALID_COMPILER_OPTIONS;
}
// Build the program programs associated with the given devices.
for (const auto& it : devices) {
option::Options parsedOptions;
constexpr bool LinkOptsOnly = false;
if (!ParseAllOptions(cppstr, parsedOptions, optionChangable, LinkOptsOnly,
it->settings().useLightning_)) {
programLog_ = parsedOptions.optionsLog();
LogError("Parsing compile options failed.");
return CL_INVALID_COMPILER_OPTIONS;
}
device::Program* devProgram = getDeviceProgram(*it);
if (devProgram == NULL) {
const binary_t& bin = binary(*it);
+1 -1
Visa fil
@@ -182,7 +182,7 @@ class Program : public RuntimeObject {
static int GetOclCVersion(const char* clVer);
bool static ParseAllOptions(const std::string& options, option::Options& parsedOptions,
bool optionChangable = true, bool linkOptsOnly = false, bool isLC = false);
bool optionChangable, bool linkOptsOnly, bool isLC);
void setVarInfoCallBack(VarInfoCallback callback) {
varcallback = callback;