P4 to Git Change 1727059 by asalmanp@asalmanp-ocl-stg on 2019/01/07 17:48:44
SWDEV-132899 - [OCL][GFX10] report number of WGP by default on gfx10 ASICs Both HSAIL/SC and LC compilers use WGP mode by default on gfx10 ASICs (i.e., COMPUTE_PGM_RSRC1.WGP_MODE is set to 1 by both compilers) therefore runtime should report number of WGP (i.e., CU/2) on gfx10 ASICs by default. The new environment variable (GPU_ENABLE_WGP_MODE = 0) can be used to force CU mode on LC (i.e., -mcumode option) if its needed (HSAIL/SC doesn't have any compiler option for forcing the CU mode) Also, using the new environment variable (GPU_ENABLE_WAVE32_MODE) to control the wave32 mode on gfx10+. ReviewRequestURL = http://ocltc.amd.com/reviews/r/16435/diff/ Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#329 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/devprogram.cpp#27 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/paldevice.cpp#121 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#65 edit ... //depot/stg/opencl/drivers/opencl/runtime/utils/flags.hpp#301 edit
This commit is contained in:
@@ -604,6 +604,14 @@ bool Program::compileImplLC(const std::string& sourceCode,
|
||||
// Set whole program mode
|
||||
driverOptions.append(" -mllvm -amdgpu-early-inline-all -mllvm -amdgpu-prelink");
|
||||
|
||||
if (!device().settings().enableWgpMode_) {
|
||||
driverOptions.append(" -mcumode");
|
||||
}
|
||||
|
||||
if (device().settings().lcWavefrontSize64_) {
|
||||
driverOptions.append(" -mwavefrontsize64");
|
||||
}
|
||||
|
||||
// Iterate through each source code and dump it into tmp
|
||||
std::fstream f;
|
||||
std::vector<std::string> headerFileNames(headers.size());
|
||||
@@ -1405,6 +1413,14 @@ bool Program::linkImplLC(amd::option::Options* options) {
|
||||
// Set whole program mode
|
||||
codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all");
|
||||
|
||||
if (!device().settings().enableWgpMode_) {
|
||||
codegenOptions.append(" -mcumode");
|
||||
}
|
||||
|
||||
if (device().settings().lcWavefrontSize64_) {
|
||||
codegenOptions.append(" -mwavefrontsize64");
|
||||
}
|
||||
|
||||
// NOTE: The params is also used to identy cached code object. This parameter
|
||||
// should not contain any dyanamically generated filename.
|
||||
char* executable = nullptr;
|
||||
@@ -1615,6 +1631,14 @@ bool Program::linkImplLC(amd::option::Options* options) {
|
||||
// Set whole program mode
|
||||
codegenOptions.append(" -mllvm -amdgpu-internalize-symbols -mllvm -amdgpu-early-inline-all");
|
||||
|
||||
if (!device().settings().enableWgpMode_) {
|
||||
codegenOptions.append(" -mcumode");
|
||||
}
|
||||
|
||||
if (device().settings().lcWavefrontSize64_) {
|
||||
codegenOptions.append(" -mwavefrontsize64");
|
||||
}
|
||||
|
||||
// Tokenize the options string into a vector of strings
|
||||
std::istringstream strstr(codegenOptions);
|
||||
std::istream_iterator<std::string> sit(strstr), end;
|
||||
@@ -1724,14 +1748,14 @@ bool Program::linkImplHSAIL(amd::option::Options* options) {
|
||||
if (device().isFineGrainedSystem(true)) {
|
||||
fin_options.append(" -sc-xnack-iommu");
|
||||
}
|
||||
if (device().settings().gfx10Hsail_) {
|
||||
if (GPU_FORCE_WAVE_SIZE_32) {
|
||||
fin_options.append(" -force-wave-size-32");
|
||||
}
|
||||
if (xnackEnabled_) {
|
||||
fin_options.append(" -xnack");
|
||||
}
|
||||
}
|
||||
|
||||
if (device().settings().enableWave32Mode_) {
|
||||
fin_options.append(" -force-wave-size-32");
|
||||
}
|
||||
|
||||
if (device().settings().hsailExplicitXnack_) {
|
||||
fin_options.append(" -xnack");
|
||||
}
|
||||
|
||||
errorCode = aclCompile(device().compiler(), binaryElf_, fin_options.c_str(), ACL_TYPE_CG,
|
||||
ACL_TYPE_ISA, logFunction);
|
||||
|
||||
Reference in New Issue
Block a user