mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-07 21:27:04 +08:00
Use GfxPartition for GPU address range allocations
[2/n] - OsAgnosticMemoryManager Related-To: NEO-2877 Change-Id: I887126362381ac960608a2150fae211631d3cd5b Signed-off-by: Venevtsev, Igor <igor.venevtsev@intel.com>
This commit is contained in:
committed by
sys_ocldev
parent
bb6dfd4fe6
commit
165d1e4e55
@@ -7,8 +7,17 @@
|
||||
|
||||
#include "runtime/os_interface/linux/allocator_helper.h"
|
||||
|
||||
#include "core/helpers/basic_math.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
size_t getSizeToMap() {
|
||||
return static_cast<size_t>(1 * 1024 * 1024u);
|
||||
}
|
||||
|
||||
size_t getSizeToReserve() {
|
||||
// 4 x sizeof(Heap32) + 2 x sizeof(Standard/Standard64k)
|
||||
return (4 * 4 + 2 * 4) * GB;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
*
|
||||
*/
|
||||
|
||||
#include "core/helpers/basic_math.h"
|
||||
#include "runtime/os_interface/linux/allocator_helper.h"
|
||||
|
||||
#include "gtest/gtest.h"
|
||||
@@ -12,3 +13,7 @@
|
||||
TEST(AllocatorHelper, givenExpectedSizeToMapWhenGetSizetoMapCalledThenExpectedValueReturned) {
|
||||
EXPECT_EQ(1 * 1024 * 1024u, NEO::getSizeToMap());
|
||||
}
|
||||
|
||||
TEST(AllocatorHelper, givenExpectedSizeToReserveWhenGetSizeToReserveCalledThenExpectedValueReturned) {
|
||||
EXPECT_EQ((4 * 4 + 2 * 4) * GB, NEO::getSizeToReserve());
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user