SWDEV-309286 - save the max system mem size in device info

Change-Id: I9955625aca6ceda059aef6354d909de636b610ba
This commit is contained in:
Satyanvesh Dittakavi
2021-11-24 18:56:53 +00:00
parent 1df0ddefe4
commit 9dabdcdc3e
3 changed files with 9 additions and 0 deletions
+3
View File
@@ -309,6 +309,9 @@ struct Info : public amd::EmbeddedObject {
//! Max size of memory object allocation in bytes.
uint64_t maxMemAllocSize_;
//! Max size of system memory allocation in bytes.
size_t maxPhysicalMemAllocSize_;
//! Max width of 2D image in pixels.
size_t image2DMaxWidth_;
+3
View File
@@ -424,6 +424,9 @@ void NullDevice::fillDeviceInfo(const Pal::DeviceProperties& palProp,
// reduced by default
info_.maxMemAllocSize_ = std::min(info_.maxMemAllocSize_, info_.globalMemSize_);
// Maximum system memory allocation size allowed
info_.maxPhysicalMemAllocSize_ = amd::Os::getPhysicalMemSize();
// We need to verify that we are not reporting more global memory
// that 4x single alloc
info_.globalMemSize_ = std::min(4 * info_.maxMemAllocSize_, info_.globalMemSize_);
+3
View File
@@ -1227,6 +1227,9 @@ bool Device::populateOCLDeviceConstants() {
info_.maxMemAllocSize_ = std::min(info_.maxMemAllocSize_, info_.globalMemSize_);
info_.maxMemAllocSize_ = amd::alignDown(info_.maxMemAllocSize_, sizeof(uint64_t));
// Maximum system memory allocation size allowed
info_.maxPhysicalMemAllocSize_ = amd::Os::getPhysicalMemSize();
// make sure we don't run anything over 8 params for now
info_.maxParameterSize_ = 1024;