mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Fix alignment for host allocations.
- it is 4k not 64k. Signed-off-by: Michal Mrozek <michal.mrozek@intel.com>
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
15ac453a5f
commit
151aaf7678
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2021 Intel Corporation
|
||||
* Copyright (C) 2019-2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@ -806,6 +806,21 @@ TEST_F(UnifiedMemoryManagerPropertiesTest,
|
||||
svmManager->freeSVMAlloc(ptr);
|
||||
}
|
||||
|
||||
TEST_F(UnifiedMemoryManagerPropertiesTest,
|
||||
given1ByteAsAllocationSizeWhenHostMemAllocIsCreatedItIsAlignedTo4k) {
|
||||
std::set<uint32_t> rootDeviceIndices{mockRootDeviceIndex};
|
||||
std::map<uint32_t, DeviceBitfield> deviceBitfields{{mockRootDeviceIndex, DeviceBitfield(0x1)}};
|
||||
SVMAllocsManager::UnifiedMemoryProperties unifiedMemoryProperties(InternalMemoryType::HOST_UNIFIED_MEMORY, rootDeviceIndices, deviceBitfields);
|
||||
|
||||
svmManager->multiOsContextSupport = true;
|
||||
auto ptr = svmManager->createHostUnifiedMemoryAllocation(1u, unifiedMemoryProperties);
|
||||
|
||||
auto allocation = svmManager->getSVMAlloc(ptr);
|
||||
EXPECT_EQ(MemoryConstants::pageSize, allocation->gpuAllocations.getDefaultGraphicsAllocation()->getUnderlyingBufferSize());
|
||||
|
||||
svmManager->freeSVMAlloc(ptr);
|
||||
}
|
||||
|
||||
TEST_F(UnifiedMemoryManagerPropertiesTest,
|
||||
givenSvmManagerMultiOsContextSupportFlagFalseWhenRootDeviceIsMultiThenMultiStorageFlagFalse) {
|
||||
std::set<uint32_t> rootDeviceIndices{mockRootDeviceIndex};
|
||||
|
Reference in New Issue
Block a user