Code cleanup - constexpr for bitness ults

Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com>
This commit is contained in:
Kamil Kopryk
2021-05-24 13:49:09 +00:00
committed by Compute-Runtime-Automation
parent 72a0621dc2
commit 7fdab76d96
19 changed files with 42 additions and 48 deletions

View File

@ -313,7 +313,7 @@ TEST(MemoryManagerTest, givenForced32BitSetWhenGraphicsMemoryFor32BitAllowedType
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
if (is64bit) {
if constexpr (is64bit) {
EXPECT_TRUE(allocation->is32BitAllocation());
EXPECT_EQ(MemoryPool::System4KBPagesWith32BitGpuAddressing, allocation->getMemoryPool());
} else {
@ -461,7 +461,7 @@ TEST(MemoryManagerTest, givenForced32BitAndEnabled64kbPagesWhenGraphicsMemoryMus
auto allocation = memoryManager.allocateGraphicsMemory(allocData);
ASSERT_NE(nullptr, allocation);
if (is64bit) {
if constexpr (is64bit) {
EXPECT_TRUE(allocation->is32BitAllocation());
} else {
EXPECT_FALSE(allocation->is32BitAllocation());

View File

@ -568,7 +568,7 @@ HWTEST_F(MemoryAllocatorTest, givenStatefulKernelWithPrintfWhenPrintfSurfaceIsCr
TEST_F(MemoryAllocatorTest, given32BitDeviceWhenPrintfSurfaceIsCreatedThen32BitAllocationsIsMade) {
DebugManagerStateRestore dbgRestorer;
if (is64bit) {
if constexpr (is64bit) {
DebugManager.flags.Force32bitAddressing.set(true);
auto device = std::make_unique<MockClDevice>(MockDevice::createWithNewExecutionEnvironment<MockDevice>(defaultHwInfo.get()));
@ -2816,4 +2816,4 @@ TEST(MemoryManagerTest, givenDuplicateRootDeviceIndicesWhenCreatingMultiGraphics
EXPECT_EQ(mockRootDeviceIndex, allocation->getRootDeviceIndex());
memoryManager.freeGraphicsMemory(allocation);
}
}