Files
compute-runtime/unit_tests/memory_manager/memory_pool_tests.cpp
Zbigniew Zdanowicz b1d82cd87e Add Local memory to MemoryPool
Change-Id: I908d4d99b53ed3ab959bbdc094cc1ae7bdfe2971
Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
2019-03-18 16:18:21 +01:00

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]));
}
}