P4 to Git Change 1740048 by wchau@wchau_OCL_Linux on 2019/02/05 14:10:40

SWDEV-134107 - Add support for respecting target's xnack setting
	- Enable the XNACK feature for all the APU system and remove the xnackEnabled_ field in AMDDeviceInfo struct

Affected files ...

... //depot/stg/opencl/drivers/opencl/runtime/device/device.hpp#332 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdefs.hpp#23 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#116 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#98 edit
... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#41 edit
This commit is contained in:
foreman
2019-02-05 14:44:09 -05:00
parent fad3d44aa9
commit 1fa47a7398
5 changed files with 25 additions and 27 deletions
+2 -1
View File
@@ -527,7 +527,8 @@ class Settings : public amd::HeapObject {
uint enableWgpMode_ : 1; //!< Enable WGP mode for this device
uint enableWave32Mode_ : 1; //!< Enable Wave32 mode for this device
uint lcWavefrontSize64_ : 1; //!< Enable Wave64 mode for this device
uint reserved_ : 15;
uint enableXNACK_ : 1; //!< Enable XNACK feature
uint reserved_ : 14;
};
uint value_;
};
+17 -18
View File
@@ -26,7 +26,6 @@ struct AMDDeviceInfo {
uint localMemBanks_; //!< Number of banks of local memory
uint gfxipVersion_; //!< The core engine GFXIP version
uint pciDeviceId_; //!< PCIe device id
bool xnackEnabled_; //!< Enable XNACK feature
};
// The device ID must match with the device's index into DeviceInfo
@@ -52,28 +51,28 @@ const HsaDeviceId HSA_INVALID_DEVICE_ID = -1;
static const AMDDeviceInfo DeviceInfo[] = {
// targetName machineTarget
/* TARGET_KAVERI_SPECTRE */ {HSA_SPECTRE_ID, "", "kaveri", "", "Spectre", 4, 16, 1, 256, 64 * Ki,
32, 0, 0, false},
32, 0, 0},
/* TARGET_KAVERI_SPOOKY */ {HSA_SPOOKY_ID, "", "kaveri", "", "Spooky", 4, 16, 1, 256, 64 * Ki, 32,
0, 0, false},
/* TARGET_TONGA */ {HSA_TONGA_ID, "", "tonga", "gfx802", "Tonga", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
0, 0},
/* TARGET_TONGA */ {HSA_TONGA_ID, "", "tonga", "gfx802", "Tonga", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET_CARRIZO */ {HSA_CARRIZO_ID, "", "carrizo", "gfx801", "Carrizo", 4, 16, 1, 256, 64 * Ki, 32, 0,
0, true},
0},
/* TARGET_ICELAND */ {HSA_ICELAND_ID, "", "iceland", "gfx802", "Iceland", 4, 16, 1, 256, 64 * Ki, 32, 0,
0, false},
/* TARGET_FIJI */ {HSA_FIJI_ID, "", "fiji", "gfx803", "Fiji", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
/* TARGET HAWAII */ {HSA_HAWAII_ID, "", "hawaii", "gfx701", "Hawaii", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
0},
/* TARGET_FIJI */ {HSA_FIJI_ID, "", "fiji", "gfx803", "Fiji", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET HAWAII */ {HSA_HAWAII_ID, "", "hawaii", "gfx701", "Hawaii", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET ELLESMERE */ {HSA_ELLESMERE_ID, "", "polaris10", "gfx803", "Ellesmere", 4, 16, 1, 256, 64 * Ki,
32, 0, 0, false},
32, 0, 0},
/* TARGET BAFFIN */ {HSA_BAFFIN_ID, "", "polaris11", "gfx803", "Baffin", 4, 16, 1, 256, 64 * Ki, 32, 0,
0, false},
/* TARGET VEGA10 */ {HSA_VEGA10_ID, "", "gfx900", "gfx900", "gfx900", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
/* TARGET VEGA10_HBCC */ {HSA_VEGA10_HBCC_ID, "", "gfx901", "gfx901", "gfx901", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
/* TARGET RAVEN */ {HSA_RAVEN_ID, "", "gfx902", "gfx902", "gfx902", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, true},
/* TARGET VEGA12 */ {HSA_VEGA12_ID, "", "gfx904", "gfx904", "gfx904", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
/* TARGET VEGA20 */ {HSA_VEGA20_ID, "", "gfx906", "gfx906", "gfx906", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
/* TARGET ARIEL */ {HSA_ARIEL_ID, "", "gfx1000", "gfx1000", "gfx1000", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
/* TARGET NAVI10 */ {HSA_NAVI10_ID, "", "gfx1010", "gfx1010", "gfx1010", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false},
/* TARGET MI100 */ {HSA_MI100_ID, "", "gfx908", "gfx908", "gfx908", 4, 16, 1, 256, 64 * Ki, 32, 0, 0, false}};
0},
/* TARGET VEGA10 */ {HSA_VEGA10_ID, "", "gfx900", "gfx900", "gfx900", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET VEGA10_HBCC */ {HSA_VEGA10_HBCC_ID, "", "gfx901", "gfx901", "gfx901", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET RAVEN */ {HSA_RAVEN_ID, "", "gfx902", "gfx902", "gfx902", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET VEGA12 */ {HSA_VEGA12_ID, "", "gfx904", "gfx904", "gfx904", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET VEGA20 */ {HSA_VEGA20_ID, "", "gfx906", "gfx906", "gfx906", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET ARIEL */ {HSA_ARIEL_ID, "", "gfx1000", "gfx1000", "gfx1000", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET NAVI10 */ {HSA_NAVI10_ID, "", "gfx1010", "gfx1010", "gfx1010", 4, 16, 1, 256, 64 * Ki, 32, 0, 0},
/* TARGET MI100 */ {HSA_MI100_ID, "", "gfx908", "gfx908", "gfx908", 4, 16, 1, 256, 64 * Ki, 32, 0, 0}};
}
const uint kMaxAsyncQueues = 8; // set to match the number of pipes, which is 8
+2 -2
View File
@@ -658,7 +658,7 @@ bool Device::create() {
// with dash as delimiter to be compatible with Windows directory name
std::ostringstream cacheTarget;
cacheTarget << "AMD-AMDGPU-" << gfxipMajor << "-" << gfxipMinor << "-" << gfxipStepping;
if (deviceInfo_.xnackEnabled_) {
if (settings().enableXNACK_) {
cacheTarget << "-xnack";
}
@@ -852,7 +852,7 @@ bool Device::populateOCLDeviceConstants() {
std::ostringstream oss;
oss << "gfx" << gfxipMajor << gfxipMinor << gfxipStepping;
if (settings().useLightning_ && deviceInfo_.xnackEnabled_) {
if (settings().useLightning_ && hsa_settings->enableXNACK_) {
oss << "-xnack";
}
+2 -2
View File
@@ -112,7 +112,7 @@ bool Program::initClBinary(char* binaryIn, size_t size) {
}
HSAILProgram::HSAILProgram(roc::NullDevice& device) : roc::Program(device) {
xnackEnabled_ = dev().deviceInfo().xnackEnabled_;
xnackEnabled_ = dev().settings().enableXNACK_;
machineTarget_ = dev().deviceInfo().complibTarget_;
}
@@ -318,7 +318,7 @@ bool HSAILProgram::setKernels(amd::option::Options* options, void* binary, size_
LightningProgram::LightningProgram(roc::NullDevice& device)
: roc::Program(device) {
isLC_ = true;
xnackEnabled_ = dev().deviceInfo().xnackEnabled_;
xnackEnabled_ = dev().settings().enableXNACK_;
machineTarget_ = dev().deviceInfo().machineTargetLC_;
}
+2 -4
View File
@@ -77,10 +77,12 @@ bool Settings::create(bool fullProfile, int gfxipVersion) {
pinnedXferSize_ = 0;
stagedXferSize_ = 0;
xferBufSize_ = 0;
apuSystem_ = true;
} else {
pinnedXferSize_ = std::max(pinnedXferSize_, pinnedMinXferSize_);
stagedXferSize_ = std::max(stagedXferSize_, pinnedMinXferSize_ + 4 * Ki);
}
enableXNACK_ = apuSystem_ ? 1 : 0 ; // enable xnack for APU system
// Enable extensions
enableExtension(ClKhrByteAddressableStore);
@@ -118,10 +120,6 @@ bool Settings::create(bool fullProfile, int gfxipVersion) {
enableExtension(ClAmdFp64);
}
if (gfxipVersion == 902) {
apuSystem_ = true;
}
// Override current device settings
override();