P4 to Git Change 1461094 by akasauro@akasauro_fiji1_opencl_rocm on 2017/09/20 11:23:36
SWDEV-118564 - [OCL-LC-ROCm] Remove options, which have already been moved to AMDGPUToolChain by https://reviews.llvm.org/rL312524
In order to have similar set of optipons for online and offline compilation a mechanism of setting default options in AMDGPUToolChain was implemented by https://reviews.llvm.org/rL312524. That commit also sets two default options in AMDGPUToolChain: -m64 and -O3 (the latter only set if there is no -O{N} option in the args). The commit has already reached amd-common.
The current change relates to LC only and removes setting of -m64 from compileImpl_LC() as it is set later in TranslateArgs(); for online -O{N} is set as before by RT and stays unchanged in AMDGPUToolChain; for offline it is set to -O3 by TranslateArgs() if no -O{N} is passed through args.
Also remove comments regarding "-x cl" as it is now correctly set in OpenCL driver.
Review: http://ocltc.amd.com/reviews/r/13454/
Affected files ...
... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palcompiler.cpp#18 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/roccompiler.cpp#36 edit
[ROCm/clr commit: a348a08391]
Этот коммит содержится в:
@@ -229,11 +229,11 @@ bool LightningProgram::compileImpl(const std::string& sourceCode,
|
||||
}
|
||||
|
||||
// Set the options for the compiler
|
||||
// Some options are set in Clang AMDGPUToolChain (like -m64)
|
||||
std::ostringstream ostrstr;
|
||||
std::copy(options->clangOptions.begin(), options->clangOptions.end(),
|
||||
std::ostream_iterator<std::string>(ostrstr, " "));
|
||||
|
||||
ostrstr << " -m" << sizeof(void*) * 8;
|
||||
std::string driverOptions(ostrstr.str());
|
||||
|
||||
const char* xLang = options->oVariables->XLang;
|
||||
@@ -241,9 +241,6 @@ bool LightningProgram::compileImpl(const std::string& sourceCode,
|
||||
buildLog_ += "Unsupported OpenCL language.\n";
|
||||
}
|
||||
|
||||
// FIXME_Nikolay: the program manager should be setting the language
|
||||
// driverOptions.append(" -x cl");
|
||||
|
||||
driverOptions.append(" -cl-std=").append(options->oVariables->CLStd);
|
||||
|
||||
// Set the -O#
|
||||
|
||||
@@ -71,11 +71,11 @@ bool HSAILProgram::compileImpl_LC(const std::string& sourceCode,
|
||||
}
|
||||
|
||||
// Set the options for the compiler
|
||||
// Some options are set in Clang AMDGPUToolChain (like -m64)
|
||||
std::ostringstream ostrstr;
|
||||
std::copy(options->clangOptions.begin(), options->clangOptions.end(),
|
||||
std::ostream_iterator<std::string>(ostrstr, " "));
|
||||
|
||||
ostrstr << " -m" << sizeof(void*) * 8;
|
||||
std::string driverOptions(ostrstr.str());
|
||||
|
||||
const char* xLang = options->oVariables->XLang;
|
||||
@@ -83,9 +83,6 @@ bool HSAILProgram::compileImpl_LC(const std::string& sourceCode,
|
||||
buildLog_ += "Unsupported OpenCL language.\n";
|
||||
}
|
||||
|
||||
// FIXME_Nikolay: the program manager should be setting the language
|
||||
// driverOptions.append(" -x cl");
|
||||
|
||||
driverOptions.append(" -cl-std=").append(options->oVariables->CLStd);
|
||||
|
||||
// Set the -O#
|
||||
|
||||
Ссылка в новой задаче
Block a user