Decrease maxMemAllocSize for BDW to 2040MB

Change-Id: I239fc513c829589f4f457ac23b49c302712f8db8
This commit is contained in:
Koska, Andrzej
2018-06-08 16:42:29 +02:00
committed by sys_ocldev
parent b21f738479
commit d74e179aee
6 changed files with 25 additions and 3 deletions

View File

@@ -259,9 +259,8 @@ void Device::initializeCaps() {
// OpenCL 1.2 requires 128MB minimum
auto maxMemAllocSize = std::max((uint64_t)(deviceInfo.globalMemSize / 2), (uint64_t)(128 * MB));
//With statefull messages we have an allocation cap of 4GB
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
deviceInfo.maxMemAllocSize = std::min((uint64_t)((4 * GB) - (8 * KB)), maxMemAllocSize);
deviceInfo.maxMemAllocSize = std::min(maxMemAllocSize, hwCaps.maxMemAllocSize);
deviceInfo.maxConstantBufferSize = deviceInfo.maxMemAllocSize;
static const int maxPixelSize = 16;

View File

@@ -22,6 +22,7 @@
#include "runtime/helpers/hw_helper.h"
#include "runtime/helpers/hw_helper.inl"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
typedef BDWFamily Family;
@@ -40,6 +41,7 @@ template <>
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps) {
caps->image3DMaxHeight = 2048;
caps->image3DMaxWidth = 2048;
caps->maxMemAllocSize = 2 * MemoryConstants::gigaByte - 8 * MemoryConstants::megaByte;
}
template class HwHelperHw<Family>;

View File

@@ -22,6 +22,7 @@
#include "runtime/helpers/hw_helper.h"
#include "runtime/helpers/hw_info.h"
#include "runtime/memory_manager/memory_constants.h"
namespace OCLRT {
template <typename Family>
@@ -37,6 +38,9 @@ template <typename Family>
void HwHelperHw<Family>::setupHardwareCapabilities(HardwareCapabilities *caps) {
caps->image3DMaxHeight = 16384;
caps->image3DMaxWidth = 16384;
//With statefull messages we have an allocation cap of 4GB
//Reason to subtract 8KB is that driver may pad the buffer with addition pages for over fetching..
caps->maxMemAllocSize = (4ULL * MemoryConstants::gigaByte) - (8ULL * MemoryConstants::kiloByte);
}
template <typename Family>

View File

@@ -80,6 +80,7 @@ struct RuntimeCapabilityTable {
struct HardwareCapabilities {
size_t image3DMaxWidth;
size_t image3DMaxHeight;
uint64_t maxMemAllocSize;
};
struct HardwareInfo {