mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-26 15:03:02 +08:00
Change-Id: I908d4d99b53ed3ab959bbdc094cc1ae7bdfe2971 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
35 lines
1.2 KiB
C++
35 lines
1.2 KiB
C++
/*
|
|
* Copyright (C) 2018-2019 Intel Corporation
|
|
*
|
|
* SPDX-License-Identifier: MIT
|
|
*
|
|
*/
|
|
|
|
#include "runtime/helpers/array_count.h"
|
|
#include "runtime/memory_manager/memory_pool.h"
|
|
|
|
#include "gtest/gtest.h"
|
|
|
|
TEST(MemoryPool, givenSystemMemoryPoolTypesWhenIsSystemMemoryPoolIsCalledThenTrueIsReturned) {
|
|
|
|
MemoryPool::Type systemMemoryTypes[] = {MemoryPool::System4KBPages,
|
|
MemoryPool::System4KBPagesWith32BitGpuAddressing,
|
|
MemoryPool::System64KBPages,
|
|
MemoryPool::System64KBPagesWith32BitGpuAddressing};
|
|
|
|
for (size_t i = 0; i < arrayCount(systemMemoryTypes); i++) {
|
|
EXPECT_TRUE(MemoryPool::isSystemMemoryPool(systemMemoryTypes[i]));
|
|
}
|
|
}
|
|
|
|
TEST(MemoryPool, givenNonSystemMemoryPoolTypesWhenIsSystemMemoryPoolIsCalledThenFalseIsReturned) {
|
|
|
|
MemoryPool::Type memoryTypes[] = {MemoryPool::MemoryNull,
|
|
MemoryPool::SystemCpuInaccessible,
|
|
MemoryPool::LocalMemory};
|
|
|
|
for (size_t i = 0; i < arrayCount(memoryTypes); i++) {
|
|
EXPECT_FALSE(MemoryPool::isSystemMemoryPool(memoryTypes[i]));
|
|
}
|
|
}
|