P4 to Git Change 1397729 by kzhuravl@kzhuravl-fiji-ocllc on 2017/04/12 20:05:08
SWDEV-116535 - Report CL_FP_DENORM for single fp config for gfx9 for LC for rocm/pal and force denorms on based on AMD_GPU_FORCE_SINGLE_FP_DENORM for rocm. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/device/pal/palsettings.cpp#23 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocdevice.cpp#47 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocprogram.cpp#62 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.cpp#16 edit ... //depot/stg/opencl/drivers/opencl/runtime/device/rocm/rocsettings.hpp#7 edit
Цей коміт міститься в:
@@ -414,6 +414,14 @@ Settings::create(
|
||||
resourceCacheSize_ = std::min(resourceCacheSize_, 512 * Mi);
|
||||
#endif
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER)
|
||||
switch (palProp.gfxLevel) {
|
||||
case Pal::GfxIpLevel::GfxIp9:
|
||||
singleFpDenorm_ = true;
|
||||
break;
|
||||
}
|
||||
#endif // WITH_LIGHTNING_COMPILER
|
||||
|
||||
// Override current device settings
|
||||
override();
|
||||
|
||||
|
||||
@@ -99,7 +99,7 @@ bool NullDevice::create(const AMDDeviceInfo& deviceInfo) {
|
||||
|
||||
settings_ = new Settings();
|
||||
roc::Settings* hsaSettings = static_cast<roc::Settings*>(settings_);
|
||||
if ((hsaSettings == nullptr) || !hsaSettings->create(false)) {
|
||||
if ((hsaSettings == nullptr) || !hsaSettings->create(false, deviceInfo_.gfxipVersion_)) {
|
||||
LogError("Error creating settings for nullptr HSA device");
|
||||
return false;
|
||||
}
|
||||
@@ -618,7 +618,7 @@ Device::mapHSADeviceToOpenCLDevice(hsa_agent_t dev)
|
||||
settings_ = new Settings();
|
||||
roc::Settings* hsaSettings = static_cast<roc::Settings*>(settings_);
|
||||
if ((hsaSettings == nullptr) ||
|
||||
!hsaSettings->create((agent_profile_ == HSA_PROFILE_FULL))) {
|
||||
!hsaSettings->create((agent_profile_ == HSA_PROFILE_FULL), deviceInfo_.gfxipVersion_)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -978,6 +978,11 @@ Device::populateOCLDeviceConstants()
|
||||
info_.doubleFPConfig_ = info_.singleFPConfig_ | CL_FP_DENORM;
|
||||
info_.singleFPConfig_ |= CL_FP_CORRECTLY_ROUNDED_DIVIDE_SQRT;
|
||||
}
|
||||
|
||||
if (hsa_settings->singleFpDenorm_) {
|
||||
info_.singleFPConfig_ |= CL_FP_DENORM;
|
||||
}
|
||||
|
||||
info_.preferredPlatformAtomicAlignment_ = 0;
|
||||
info_.preferredGlobalAtomicAlignment_ = 0;
|
||||
info_.preferredLocalAtomicAlignment_ = 0;
|
||||
|
||||
@@ -1397,7 +1397,8 @@ HSAILProgram::codegenOptions(amd::option::Options* options)
|
||||
std::string optionsStr;
|
||||
|
||||
#if !defined(WITH_LIGHTNING_COMPILER)
|
||||
if (dev().deviceInfo().gfxipVersion_ < 900) {
|
||||
if (dev().deviceInfo().gfxipVersion_ < 900 ||
|
||||
!dev().settings().singleFpDenorm_) {
|
||||
optionsStr.append(" -cl-denorms-are-zero");
|
||||
}
|
||||
#endif // !defined(WITH_LIGHTNING_COMPILER)
|
||||
|
||||
@@ -68,10 +68,13 @@ Settings::Settings()
|
||||
const static size_t MaxPinnedXferSize = 32;
|
||||
pinnedXferSize_ = std::min(GPU_PINNED_XFER_SIZE, MaxPinnedXferSize) * Mi;
|
||||
pinnedMinXferSize_ = std::min(GPU_PINNED_MIN_XFER_SIZE * Ki, pinnedXferSize_);
|
||||
|
||||
// Don't support Denormals for single precision by default
|
||||
singleFpDenorm_ = false;
|
||||
}
|
||||
|
||||
bool
|
||||
Settings::create(bool fullProfile)
|
||||
Settings::create(bool fullProfile, int gfxipVersion)
|
||||
{
|
||||
customHostAllocator_ = false;
|
||||
|
||||
@@ -111,6 +114,14 @@ Settings::create(bool fullProfile)
|
||||
enableExtension(ClKhrDepthImages);
|
||||
supportDepthsRGB_ = true;
|
||||
|
||||
#if defined(WITH_LIGHTNING_COMPILER)
|
||||
switch (gfxipVersion) {
|
||||
case 900:
|
||||
singleFpDenorm_ = true;
|
||||
break;
|
||||
}
|
||||
#endif // WITH_LIGHTNING_COMPILER
|
||||
|
||||
// Override current device settings
|
||||
override();
|
||||
|
||||
@@ -140,6 +151,19 @@ Settings::override()
|
||||
if (!flagIsDefault(GPU_PINNED_MIN_XFER_SIZE)) {
|
||||
pinnedMinXferSize_ = std::min(GPU_PINNED_MIN_XFER_SIZE * Ki, pinnedXferSize_);
|
||||
}
|
||||
|
||||
if (!flagIsDefault(AMD_GPU_FORCE_SINGLE_FP_DENORM)) {
|
||||
switch (AMD_GPU_FORCE_SINGLE_FP_DENORM) {
|
||||
case 0:
|
||||
singleFpDenorm_ = false;
|
||||
break;
|
||||
case 1:
|
||||
singleFpDenorm_ = true;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
} // namespace roc
|
||||
|
||||
@@ -29,7 +29,8 @@ public:
|
||||
uint imageDMA_: 1; //!< Enable direct image DMA transfers
|
||||
uint stagedXferRead_: 1; //!< Uses a staged buffer read
|
||||
uint stagedXferWrite_: 1; //!< Uses a staged buffer write
|
||||
uint reserved_: 22;
|
||||
uint singleFpDenorm_: 1; //!< Support Single FP Denorm
|
||||
uint reserved_: 21;
|
||||
};
|
||||
uint value_;
|
||||
};
|
||||
@@ -58,7 +59,7 @@ public:
|
||||
Settings();
|
||||
|
||||
//! Creates settings
|
||||
bool create(bool fullProfile);
|
||||
bool create(bool fullProfile, int gfxipVersion);
|
||||
|
||||
private:
|
||||
//! Disable copy constructor
|
||||
|
||||
Посилання в новій задачі
Заблокувати користувача