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
Этот коммит содержится в:
foreman
2019-08-28 18:09:33 -04:00
родитель c875e5bbf2
Коммит cb4e7b6be6
3 изменённых файлов: 32 добавлений и 21 удалений
+27 -19
Просмотреть файл
@@ -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);