Skip to content

Commit e24322f

Browse files
Debug flag to control MI_ARB_CHECK prefetcher
Signed-off-by: Bartosz Dunajski <[email protected]>
1 parent 41c51df commit e24322f

File tree

12 files changed

+95
-4
lines changed

12 files changed

+95
-4
lines changed

opencl/test/unit_test/test_files/igdrcl.config

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,3 +398,4 @@ OverridePatIndex = -1
398398
UseTileMemoryBankInVirtualMemoryCreation = -1
399399
DisableScratchPages = 0
400400
ForceAllResourcesUncached = 0
401+
ForcePreParserEnabledForMiArbCheck = -1

shared/source/command_container/command_encoder.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,7 @@ struct EncodeMiArbCheck {
378378
using MI_ARB_CHECK = typename GfxFamily::MI_ARB_CHECK;
379379

380380
static void program(LinearStream &commandStream);
381+
static void adjust(MI_ARB_CHECK &miArbCheck);
381382
static size_t getCommandSize();
382383
};
383384

shared/source/command_container/command_encoder.inl

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -798,8 +798,12 @@ inline size_t EncodeMemoryPrefetch<Family>::getSizeForMemoryPrefetch(size_t size
798798

799799
template <typename Family>
800800
void EncodeMiArbCheck<Family>::program(LinearStream &commandStream) {
801+
MI_ARB_CHECK cmd = Family::cmdInitArbCheck;
802+
803+
EncodeMiArbCheck<Family>::adjust(cmd);
804+
801805
auto miArbCheckStream = commandStream.getSpaceForCmd<MI_ARB_CHECK>();
802-
*miArbCheckStream = Family::cmdInitArbCheck;
806+
*miArbCheckStream = cmd;
803807
}
804808

805809
template <typename Family>

shared/source/command_container/command_encoder_bdw_and_later.inl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -472,4 +472,8 @@ inline void EncodeStoreMemory<Family>::programStoreDataImm(MI_STORE_DATA_IMM *cm
472472
*cmdBuffer = storeDataImmediate;
473473
}
474474

475+
template <typename Family>
476+
inline void EncodeMiArbCheck<Family>::adjust(MI_ARB_CHECK &miArbCheck) {
477+
}
478+
475479
} // namespace NEO

shared/source/command_container/command_encoder_xehp_and_later.inl

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -672,4 +672,11 @@ inline void EncodeStoreMemory<Family>::programStoreDataImm(MI_STORE_DATA_IMM *cm
672672
*cmdBuffer = storeDataImmediate;
673673
}
674674

675+
template <typename Family>
676+
inline void EncodeMiArbCheck<Family>::adjust(MI_ARB_CHECK &miArbCheck) {
677+
if (DebugManager.flags.ForcePreParserEnabledForMiArbCheck.get() != -1) {
678+
miArbCheck.setPreParserDisable(!DebugManager.flags.ForcePreParserEnabledForMiArbCheck.get());
679+
}
680+
}
681+
675682
} // namespace NEO

shared/source/debug_settings/debug_variables_base.inl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -194,6 +194,7 @@ DECLARE_DEBUG_VARIABLE(int32_t, AccessCountersGranularity, -1, "-1: default - AC
194194
DECLARE_DEBUG_VARIABLE(int32_t, OverridePatIndex, -1, "-1: default, >=0: PatIndex to override")
195195
DECLARE_DEBUG_VARIABLE(int32_t, UseTileMemoryBankInVirtualMemoryCreation, -1, "-1: default - on, 0: do not assign tile memory bank to virtual memory space, 1: assign tile memory bank to virtual memory space")
196196
DECLARE_DEBUG_VARIABLE(int32_t, OverrideTimestampEvents, -1, "-1: default (based on user settings), 0: Force disable timestamp events (no timestamps will be reported), 1: Force enable timestamp events")
197+
DECLARE_DEBUG_VARIABLE(int32_t, ForcePreParserEnabledForMiArbCheck, -1, "-1: default , 0: PreParser disabled, 1: PreParser enabled")
197198
DECLARE_DEBUG_VARIABLE(bool, DisableScratchPages, false, "Disable scratch pages during VM creations")
198199
/*LOGGING FLAGS*/
199200
DECLARE_DEBUG_VARIABLE(int32_t, PrintDriverDiagnostics, -1, "prints driver diagnostics messages to standard output, value corresponds to hint level")

shared/source/direct_submission/direct_submission_prefetcher_pvc_and_later.inl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -15,6 +15,9 @@ inline void DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchDisablePrefetcher
1515

1616
MI_ARB_CHECK arbCheck = GfxFamily::cmdInitArbCheck;
1717
arbCheck.setPreParserDisable(disable);
18+
19+
EncodeMiArbCheck<GfxFamily>::adjust(arbCheck);
20+
1821
MI_ARB_CHECK *arbCheckSpace = ringCommandStream.getSpaceForCmd<MI_ARB_CHECK>();
1922
*arbCheckSpace = arbCheck;
2023
}

shared/source/direct_submission/direct_submission_prefetcher_xe_hp_core_and_later.inl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2021 Intel Corporation
2+
* Copyright (C) 2021-2022 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -15,6 +15,9 @@ inline void DirectSubmissionHw<GfxFamily, Dispatcher>::dispatchDisablePrefetcher
1515

1616
MI_ARB_CHECK arbCheck = GfxFamily::cmdInitArbCheck;
1717
arbCheck.setPreFetchDisable(disable);
18+
19+
EncodeMiArbCheck<GfxFamily>::adjust(arbCheck);
20+
1821
MI_ARB_CHECK *arbCheckSpace = ringCommandStream.getSpaceForCmd<MI_ARB_CHECK>();
1922
*arbCheckSpace = arbCheck;
2023
}

shared/source/generated/xe_hp_core/hw_cmds_generated_xe_hp_core.inl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5690,6 +5690,17 @@ typedef struct tagMI_ARB_CHECK {
56905690
inline uint32_t getPreFetchDisable() const {
56915691
return TheStructure.Common.Pre_FetchDisable;
56925692
}
5693+
5694+
// patched for easier templates usage
5695+
inline void setPreParserDisable(const uint32_t value) {
5696+
setPreFetchDisable(value);
5697+
}
5698+
5699+
// patched for easier templates usage
5700+
inline uint32_t getPreParserDisable() const {
5701+
return getPreFetchDisable();
5702+
}
5703+
56935704
inline void setMaskBits(const uint32_t value) {
56945705
DEBUG_BREAK_IF(value > 0xff00);
56955706
TheStructure.Common.MaskBits = value;

shared/source/generated/xe_hpg_core/hw_cmds_generated_xe_hpg_core.inl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5761,6 +5761,17 @@ typedef struct tagMI_ARB_CHECK {
57615761
inline uint32_t getPreFetchDisable() const {
57625762
return TheStructure.Common.Pre_FetchDisable;
57635763
}
5764+
5765+
// patched for easier templates usage
5766+
inline void setPreParserDisable(const uint32_t value) {
5767+
setPreFetchDisable(value);
5768+
}
5769+
5770+
// patched for easier templates usage
5771+
inline uint32_t getPreParserDisable() const {
5772+
return getPreFetchDisable();
5773+
}
5774+
57645775
inline void setMaskBits(const uint32_t value) {
57655776
DEBUG_BREAK_IF(value > 0xff00);
57665777
TheStructure.Common.MaskBits = value;

0 commit comments

Comments
 (0)