SWDEV-309286 - save the max system mem size in device info
Change-Id: I9955625aca6ceda059aef6354d909de636b610ba
This commit is contained in:
@@ -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_;
|
||||
|
||||
|
||||
@@ -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_);
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user