Skip to content

Commit 130a7ac

Browse files
Delete TypeSelector helper
Change-Id: Iff5fe62d31fa7b07658cfcf81ebd2c12d47e2b3b Signed-off-by: Maciej Dziuban <[email protected]>
1 parent 2f7158e commit 130a7ac

15 files changed

+48
-114
lines changed

runtime/aub_mem_dump/aub_mem_dump.h

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -35,16 +35,6 @@ inline void setAddress(CmdServicesMemTraceMemoryCompare &cmd, uint64_t address)
3535
cmd.addressHigh = static_cast<uint32_t>(address >> 32);
3636
}
3737

38-
template <typename TypeTrue, typename TypeFalse, bool is32Bits>
39-
struct TypeSelector {
40-
typedef TypeTrue type;
41-
};
42-
43-
template <typename TypeTrue, typename TypeFalse>
44-
struct TypeSelector<TypeTrue, TypeFalse, false> {
45-
typedef TypeFalse type;
46-
};
47-
4838
union IAPageTableEntry {
4939
struct
5040
{
@@ -264,11 +254,11 @@ struct AubPageTableHelper64 : public AubPageTableHelper<Traits>, PageTableTraits
264254
};
265255

266256
template <typename TraitsIn>
267-
struct AubDump : public TypeSelector<AubPageTableHelper32<TraitsIn>, AubPageTableHelper64<TraitsIn>, TraitsIn::addressingBits == 32>::type {
268-
typedef TraitsIn Traits;
269-
typedef typename TypeSelector<uint32_t, uint64_t, Traits::addressingBits == 32>::type AddressType;
270-
typedef typename TypeSelector<AubPageTableHelper32<Traits>, AubPageTableHelper64<Traits>, Traits::addressingBits == 32>::type BaseHelper;
271-
typedef typename Traits::Stream Stream;
257+
struct AubDump : public std::conditional<TraitsIn::addressingBits == 32, AubPageTableHelper32<TraitsIn>, AubPageTableHelper64<TraitsIn>>::type {
258+
using Traits = TraitsIn;
259+
using AddressType = typename std::conditional<Traits::addressingBits == 32, uint32_t, uint64_t>::type;
260+
using BaseHelper = typename std::conditional<Traits::addressingBits == 32, AubPageTableHelper32<Traits>, AubPageTableHelper64<Traits>>::type;
261+
using Stream = typename Traits::Stream;
272262

273263
typedef union _MiContextDescriptorReg_ {
274264
struct {

runtime/command_stream/aub_command_stream_receiver_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ class AUBCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
9292
uint32_t aubDeviceId;
9393
bool standalone;
9494

95-
std::unique_ptr<TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type> ppgtt;
95+
std::unique_ptr<std::conditional<is64bit, PML4, PDPE>::type> ppgtt;
9696
std::unique_ptr<PDPE> ggtt;
9797
// remap CPU VA -> GGTT VA
9898
AddressMapper *gttRemap;

runtime/command_stream/aub_command_stream_receiver_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ AUBCommandStreamReceiverHw<GfxFamily>::AUBCommandStreamReceiverHw(const Hardware
4242
auto physicalAddressAllocator = aubCenter->getPhysicalAddressAllocator();
4343
UNRECOVERABLE_IF(nullptr == physicalAddressAllocator);
4444

45-
ppgtt = std::make_unique<TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type>(physicalAddressAllocator);
45+
ppgtt = std::make_unique<std::conditional<is64bit, PML4, PDPE>::type>(physicalAddressAllocator);
4646
ggtt = std::make_unique<PDPE>(physicalAddressAllocator);
4747

4848
gttRemap = aubCenter->getAddressMapper();

runtime/command_stream/tbx_command_stream_receiver_hw.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ class TbxCommandStreamReceiverHw : public CommandStreamReceiverSimulatedHw<GfxFa
8080
bool streamInitialized = false;
8181

8282
std::unique_ptr<PhysicalAddressAllocator> physicalAddressAllocator;
83-
std::unique_ptr<TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type> ppgtt;
83+
std::unique_ptr<std::conditional<is64bit, PML4, PDPE>::type> ppgtt;
8484
std::unique_ptr<PDPE> ggtt;
8585
// remap CPU VA -> GGTT VA
8686
AddressMapper gttRemap;

runtime/command_stream/tbx_command_stream_receiver_hw.inl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ TbxCommandStreamReceiverHw<GfxFamily>::TbxCommandStreamReceiverHw(const Hardware
2828

2929
physicalAddressAllocator.reset(this->createPhysicalAddressAllocator());
3030

31-
ppgtt = std::make_unique<TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type>(physicalAddressAllocator.get());
31+
ppgtt = std::make_unique<std::conditional<is64bit, PML4, PDPE>::type>(physicalAddressAllocator.get());
3232
ggtt = std::make_unique<PDPE>(physicalAddressAllocator.get());
3333

3434
for (auto &engineInfo : engineInfoTable) {

runtime/gen10/aub_mapper.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#pragma once
99
#include "runtime/gen_common/aub_mapper_base.h"
10+
#include "runtime/memory_manager/memory_constants.h"
1011

1112
namespace OCLRT {
1213
struct CNLFamily;
@@ -15,7 +16,7 @@ template <>
1516
struct AUBFamilyMapper<CNLFamily> {
1617
enum { device = AubMemDump::DeviceValues::Cnl };
1718

18-
typedef AubMemDump::Traits<device, GfxAddressBits::value> AubTraits;
19+
using AubTraits = AubMemDump::Traits<device, MemoryConstants::GfxAddressBits>;
1920

2021
static const AubMemDump::LrcaHelper *csTraits[EngineType::NUM_ENGINES];
2122

runtime/gen8/aub_mapper.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#pragma once
99
#include "runtime/gen_common/aub_mapper_base.h"
10+
#include "runtime/memory_manager/memory_constants.h"
1011

1112
namespace OCLRT {
1213
struct BDWFamily;
@@ -15,7 +16,7 @@ template <>
1516
struct AUBFamilyMapper<BDWFamily> {
1617
enum { device = AubMemDump::DeviceValues::Bdw };
1718

18-
typedef AubMemDump::Traits<device, GfxAddressBits::value> AubTraits;
19+
using AubTraits = AubMemDump::Traits<device, MemoryConstants::GfxAddressBits>;
1920

2021
static const AubMemDump::LrcaHelper *csTraits[EngineType::NUM_ENGINES];
2122

runtime/gen9/aub_mapper.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77

88
#pragma once
99
#include "runtime/gen_common/aub_mapper_base.h"
10+
#include "runtime/memory_manager/memory_constants.h"
1011

1112
namespace OCLRT {
1213
struct SKLFamily;
@@ -15,7 +16,7 @@ template <>
1516
struct AUBFamilyMapper<SKLFamily> {
1617
enum { device = AubMemDump::DeviceValues::Skl };
1718

18-
typedef AubMemDump::Traits<device, GfxAddressBits::value> AubTraits;
19+
using AubTraits = AubMemDump::Traits<device, MemoryConstants::GfxAddressBits>;
1920

2021
static const AubMemDump::LrcaHelper *csTraits[EngineType::NUM_ENGINES];
2122

runtime/gen_common/aub_mapper_base.h

Lines changed: 3 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,13 @@
11
/*
2-
* Copyright (c) 2017, Intel Corporation
2+
* Copyright (C) 2017-2018 Intel Corporation
33
*
4-
* Permission is hereby granted, free of charge, to any person obtaining a
5-
* copy of this software and associated documentation files (the "Software"),
6-
* to deal in the Software without restriction, including without limitation
7-
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
* and/or sell copies of the Software, and to permit persons to whom the
9-
* Software is furnished to do so, subject to the following conditions:
4+
* SPDX-License-Identifier: MIT
105
*
11-
* The above copyright notice and this permission notice shall be included
12-
* in all copies or substantial portions of the Software.
13-
*
14-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15-
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18-
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19-
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20-
* OTHER DEALINGS IN THE SOFTWARE.
216
*/
227

238
#pragma once
249
#include "runtime/aub_mem_dump/aub_mem_dump.h"
2510
#include "runtime/helpers/completion_stamp.h"
26-
#include "runtime/helpers/selectors.h"
2711
#include <vector>
2812

2913
namespace OCLRT {
@@ -34,4 +18,5 @@ struct AUBFamilyMapper {
3418

3519
using MMIOPair = std::pair<uint32_t, uint32_t>;
3620
using MMIOList = std::vector<MMIOPair>;
21+
3722
} // namespace OCLRT

runtime/helpers/CMakeLists.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@ set(RUNTIME_SRCS_HELPERS_BASE
6565
${CMAKE_CURRENT_SOURCE_DIR}${BRANCH_DIR_SUFFIX}/queue_helpers.cpp
6666
${CMAKE_CURRENT_SOURCE_DIR}/queue_helpers.h
6767
${CMAKE_CURRENT_SOURCE_DIR}/sampler_helpers.h
68-
${CMAKE_CURRENT_SOURCE_DIR}/selectors.h
6968
${CMAKE_CURRENT_SOURCE_DIR}/state_base_address.h
7069
${CMAKE_CURRENT_SOURCE_DIR}/state_base_address.inl
7170
${CMAKE_CURRENT_SOURCE_DIR}/stdio.h

runtime/helpers/selectors.h

Lines changed: 0 additions & 42 deletions
This file was deleted.

runtime/memory_manager/memory_constants.h

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@
1010
#include <cstddef>
1111
#include <limits>
1212

13+
constexpr bool is32bit = (sizeof(void *) == 4);
14+
constexpr bool is64bit = (sizeof(void *) == 8);
15+
1316
namespace MemoryConstants {
1417
static const uint64_t zoneHigh = ~(uint64_t)0xFFFFFFFF;
1518
static const uint64_t kiloByte = 1024;
@@ -33,7 +36,5 @@ static const uint64_t max32BitAddress = ((1ULL << 32) - 1);
3336
static const uint64_t max48BitAddress = ((1ULL << 48) - 1);
3437
static const uintptr_t page4kEntryMask = std::numeric_limits<uintptr_t>::max() & ~MemoryConstants::pageMask;
3538
static const uintptr_t page64kEntryMask = std::numeric_limits<uintptr_t>::max() & ~MemoryConstants::page64kMask;
39+
static const int GfxAddressBits = is64bit ? 48 : 32;
3640
} // namespace MemoryConstants
37-
38-
const bool is32bit = (sizeof(void *) == 4) ? true : false;
39-
const bool is64bit = (sizeof(void *) == 8) ? true : false;

unit_tests/command_stream/aub_command_stream_receiver_tests.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,8 +1589,8 @@ HWTEST_F(AubCommandStreamReceiverTests, givenAubCommandStreamReceiverWhenWriteMe
15891589
memoryManager.reset(aubCsr->createMemoryManager(false, false));
15901590

15911591
PhysicalAddressAllocator allocator;
1592-
struct PpgttMock : TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type {
1593-
PpgttMock(PhysicalAddressAllocator *allocator) : TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type(allocator) {}
1592+
struct PpgttMock : std::conditional<is64bit, PML4, PDPE>::type {
1593+
PpgttMock(PhysicalAddressAllocator *allocator) : std::conditional<is64bit, PML4, PDPE>::type(allocator) {}
15941594

15951595
void pageWalk(uintptr_t vm, size_t size, size_t offset, uint64_t entryBits, PageWalker &pageWalker, uint32_t memoryBank) override {
15961596
receivedSize = size;

unit_tests/memory_manager/address_mapper_tests.cpp

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
*/
77

88
#include "runtime/helpers/aligned_memory.h"
9-
#include "runtime/helpers/selectors.h"
109
#include "runtime/memory_manager/address_mapper.h"
1110
#include "test.h"
1211
#include "gtest/gtest.h"

unit_tests/memory_manager/page_table_tests.cpp

Lines changed: 24 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77

88
#include "runtime/aub_mem_dump/page_table_entry_bits.h"
99
#include "runtime/helpers/ptr_math.h"
10-
#include "runtime/helpers/selectors.h"
1110
#include "runtime/memory_manager/memory_banks.h"
1211
#include "runtime/memory_manager/page_table.h"
1312
#include "runtime/memory_manager/page_table.inl"
@@ -75,10 +74,10 @@ class MockPDPE : public MockPageTable<MockPDE, 2, 2> {
7574
}
7675
};
7776

78-
class PPGTTPageTable : public TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type {
77+
class PPGTTPageTable : public std::conditional<is64bit, PML4, PDPE>::type {
7978
public:
80-
const size_t ppgttEntries = IntSelector<512u, 4u, sizeof(void *) == 8>::value;
81-
PPGTTPageTable(PhysicalAddressAllocator *allocator) : TypeSelector<PML4, PDPE, sizeof(void *) == 8>::type(allocator) {
79+
const size_t ppgttEntries = is64bit ? 512u : 4u;
80+
PPGTTPageTable(PhysicalAddressAllocator *allocator) : std::conditional<is64bit, PML4, PDPE>::type(allocator) {
8281
EXPECT_EQ(ppgttEntries, entries.size());
8382
}
8483
bool isEmpty() {
@@ -105,7 +104,7 @@ class GGTTPageTable : public PDPE {
105104
class PageTableFixture {
106105
protected:
107106
const size_t pageSize = 1 << 12;
108-
const uintptr_t refAddr = (uintptr_t(1) << IntSelector<46, 31, is64Bit>::value);
107+
const uintptr_t refAddr = uintptr_t(1) << (is64Bit ? 46 : 31);
109108
MockPhysicalAddressAllocator allocator;
110109
uint64_t startAddress = 0x1000;
111110

@@ -248,8 +247,8 @@ TEST_F(PageTableTests48, givenBigGpuAddressWhenPageWalkIsCalledThenPageTablesAre
248247
}
249248

250249
TEST_F(PageTableTests48, givenZeroEntryBitsWhenPageWalkIsCalledThenPageTableEntryHasPresentBitSet) {
251-
std::unique_ptr<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>
252-
pageTable(std::make_unique<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(&allocator));
250+
std::unique_ptr<std::conditional<is64bit, MockPML4, MockPDPE>::type>
251+
pageTable(std::make_unique<std::conditional<is64bit, MockPML4, MockPDPE>::type>(&allocator));
253252

254253
uintptr_t gpuVa = 0x1000;
255254

@@ -266,25 +265,25 @@ TEST_F(PageTableTests48, givenZeroEntryBitsWhenPageWalkIsCalledThenPageTableEntr
266265
EXPECT_EQ(size, walked);
267266
ASSERT_NE(nullptr, pageTable->entries[0]);
268267

269-
PageTableEntryChecker::testEntry<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | 0x1));
268+
PageTableEntryChecker::testEntry<std::conditional<is64bit, MockPML4, MockPDPE>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | 0x1));
270269
}
271270

272271
TEST_F(PageTableTests48, givenZeroEntryBitsWhenMapIsCalledThenPageTableEntryHasPresentBitSet) {
273-
std::unique_ptr<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>
274-
pageTable(std::make_unique<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(&allocator));
272+
std::unique_ptr<std::conditional<is64bit, MockPML4, MockPDPE>::type>
273+
pageTable(std::make_unique<std::conditional<is64bit, MockPML4, MockPDPE>::type>(&allocator));
275274
uintptr_t gpuVa = 0x1000;
276275
size_t size = pageSize;
277276
auto address = allocator.mainAllocator.load();
278277

279278
pageTable->map(gpuVa, size, 0, MemoryBanks::MainBank);
280279
ASSERT_NE(nullptr, pageTable->entries[0]);
281280

282-
PageTableEntryChecker::testEntry<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | 0x1));
281+
PageTableEntryChecker::testEntry<std::conditional<is64bit, MockPML4, MockPDPE>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | 0x1));
283282
}
284283

285284
TEST_F(PageTableTests48, givenEntryBitsWhenPageWalkIsCalledThenEntryBitsArePassedToPageWalker) {
286-
std::unique_ptr<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>
287-
pageTable(std::make_unique<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(&allocator));
285+
std::unique_ptr<std::conditional<is64bit, MockPML4, MockPDPE>::type>
286+
pageTable(std::make_unique<std::conditional<is64bit, MockPML4, MockPDPE>::type>(&allocator));
288287

289288
uintptr_t gpuVa = 0x1000;
290289
size_t size = pageSize;
@@ -303,8 +302,8 @@ TEST_F(PageTableTests48, givenEntryBitsWhenPageWalkIsCalledThenEntryBitsArePasse
303302
}
304303

305304
TEST_F(PageTableTests48, givenTwoPageWalksWhenSecondWalkHasDifferentEntryBitsThenEntryIsUpdated) {
306-
std::unique_ptr<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>
307-
pageTable(std::make_unique<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(&allocator));
305+
std::unique_ptr<std::conditional<is64bit, MockPML4, MockPDPE>::type>
306+
pageTable(std::make_unique<std::conditional<is64bit, MockPML4, MockPDPE>::type>(&allocator));
308307

309308
uintptr_t gpuVa = 0x1000;
310309
size_t size = pageSize;
@@ -328,8 +327,8 @@ TEST_F(PageTableTests48, givenTwoPageWalksWhenSecondWalkHasDifferentEntryBitsThe
328327
}
329328

330329
TEST_F(PageTableTests48, givenTwoPageWalksWhenSecondWalkHasNonValidEntryBitsThenEntryIsNotUpdated) {
331-
std::unique_ptr<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>
332-
pageTable(std::make_unique<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(&allocator));
330+
std::unique_ptr<std::conditional<is64bit, MockPML4, MockPDPE>::type>
331+
pageTable(std::make_unique<std::conditional<is64bit, MockPML4, MockPDPE>::type>(&allocator));
333332

334333
uintptr_t gpuVa = 0x1000;
335334
size_t size = pageSize;
@@ -357,25 +356,25 @@ TEST_F(PageTableTests48, givenTwoPageWalksWhenSecondWalkHasNonValidEntryBitsThen
357356
}
358357

359358
TEST_F(PageTableTests48, givenTwoMapsWhenSecondMapHasDifferentEntryBitsThenEntryIsUpdated) {
360-
std::unique_ptr<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>
361-
pageTable(std::make_unique<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(&allocator));
359+
std::unique_ptr<std::conditional<is64bit, MockPML4, MockPDPE>::type>
360+
pageTable(std::make_unique<std::conditional<is64bit, MockPML4, MockPDPE>::type>(&allocator));
362361
uintptr_t gpuVa = 0x1000;
363362
size_t size = pageSize;
364363
uint64_t ppgttBits = 0xabc;
365364
auto address = allocator.mainAllocator.load();
366365

367366
pageTable->map(gpuVa, size, ppgttBits, 0);
368367
ASSERT_NE(nullptr, pageTable->entries[0]);
369-
PageTableEntryChecker::testEntry<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
368+
PageTableEntryChecker::testEntry<std::conditional<is64bit, MockPML4, MockPDPE>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
370369

371370
ppgttBits = 0x345;
372371
pageTable->map(gpuVa, size, ppgttBits, 0);
373-
PageTableEntryChecker::testEntry<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
372+
PageTableEntryChecker::testEntry<std::conditional<is64bit, MockPML4, MockPDPE>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
374373
}
375374

376375
TEST_F(PageTableTests48, givenTwoMapsWhenSecondMapHasNonValidEntryBitsThenEntryIsNotUpdated) {
377-
std::unique_ptr<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>
378-
pageTable(std::make_unique<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(&allocator));
376+
std::unique_ptr<std::conditional<is64bit, MockPML4, MockPDPE>::type>
377+
pageTable(std::make_unique<std::conditional<is64bit, MockPML4, MockPDPE>::type>(&allocator));
379378
uintptr_t gpuVa = 0x1000;
380379
size_t size = pageSize;
381380
uint64_t ppgttBits = 0xabc;
@@ -384,12 +383,12 @@ TEST_F(PageTableTests48, givenTwoMapsWhenSecondMapHasNonValidEntryBitsThenEntryI
384383
pageTable->map(gpuVa, size, ppgttBits, 0);
385384
ASSERT_NE(nullptr, pageTable->entries[0]);
386385

387-
PageTableEntryChecker::testEntry<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
386+
PageTableEntryChecker::testEntry<std::conditional<is64bit, MockPML4, MockPDPE>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
388387

389388
uint64_t nonValidPpgttBits = PageTableEntry::nonValidBits;
390389
pageTable->map(gpuVa, size, nonValidPpgttBits, 0);
391390

392-
PageTableEntryChecker::testEntry<TypeSelector<MockPML4, MockPDPE, sizeof(void *) == 8>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
391+
PageTableEntryChecker::testEntry<std::conditional<is64bit, MockPML4, MockPDPE>::type>(pageTable.get(), 1, static_cast<uintptr_t>(address | ppgttBits | 0x1));
393392
}
394393

395394
TEST_F(PageTableTests48, givenPageTableWhenMappingTheSameAddressMultipleTimesThenNumberOfPagesReservedInAllocatorMatchPagesMapped) {

0 commit comments

Comments
 (0)