mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-11 08:07:19 +08:00
Change max mem alloc size deduction.
- make it half of global mem - change buffer input validation, look for hw limitations instead of computed value of max mem alloc size. Change-Id: Ibbe7eb16d01299b02cef3b1e7234efefbced2197 Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
6a51f1fad9
commit
5dc20f50d1
@@ -210,7 +210,7 @@ TEST_F(clCreateBufferTests, GivenMemWriteOnlyFlagAndMemReadWriteFlagWhenCreating
|
||||
|
||||
TEST_F(clCreateBufferTests, GivenBufferSizeOverMaxMemAllocSizeWhenCreatingBufferThenInvalidBufferSizeErrorIsReturned) {
|
||||
auto pDevice = pContext->getDevice(0);
|
||||
size_t size = static_cast<size_t>(pDevice->getDeviceInfo().maxMemAllocSize) + 1;
|
||||
size_t size = static_cast<size_t>(pDevice->getHardwareCapabilities().maxMemAllocSize) + 1;
|
||||
|
||||
auto buffer = clCreateBuffer(pContext, CL_MEM_ALLOC_HOST_PTR, size, nullptr, &retVal);
|
||||
EXPECT_EQ(CL_INVALID_BUFFER_SIZE, retVal);
|
||||
@@ -219,7 +219,7 @@ TEST_F(clCreateBufferTests, GivenBufferSizeOverMaxMemAllocSizeWhenCreatingBuffer
|
||||
|
||||
TEST_F(clCreateBufferTests, GivenBufferSizeOverMaxMemAllocSizeWhenCreateBufferWithPropertiesINTELThenInvalidBufferSizeErrorIsReturned) {
|
||||
auto pDevice = pContext->getDevice(0);
|
||||
size_t size = static_cast<size_t>(pDevice->getDeviceInfo().maxMemAllocSize) + 1;
|
||||
size_t size = static_cast<size_t>(pDevice->getHardwareCapabilities().maxMemAllocSize) + 1;
|
||||
|
||||
auto buffer = clCreateBufferWithPropertiesINTEL(pContext, nullptr, size, nullptr, &retVal);
|
||||
EXPECT_EQ(CL_INVALID_BUFFER_SIZE, retVal);
|
||||
|
||||
@@ -341,7 +341,7 @@ TEST(Device_GetCaps, givenGlobalMemSizeWhenCalculatingMaxAllocSizeThenAdjustToHW
|
||||
auto &hwHelper = HwHelper::get(platformDevices[0]->platform.eRenderCoreFamily);
|
||||
hwHelper.setupHardwareCapabilities(&hwCaps, *platformDevices[0]);
|
||||
|
||||
uint64_t expectedSize = std::max((caps.globalMemSize), static_cast<uint64_t>(128ULL * MemoryConstants::megaByte));
|
||||
uint64_t expectedSize = std::max((caps.globalMemSize / 2), static_cast<uint64_t>(128ULL * MemoryConstants::megaByte));
|
||||
expectedSize = std::min(expectedSize, hwCaps.maxMemAllocSize);
|
||||
|
||||
EXPECT_EQ(caps.maxMemAllocSize, expectedSize);
|
||||
|
||||
Reference in New Issue
Block a user