mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Correct binding table prefetch
Signed-off-by: Kamil Kopryk <kamil.kopryk@intel.com> Related-To: NEO-6075 Binding table entry count was zeroed even when ForceBtpPrefetchMode debug flag was enabled
This commit is contained in:

committed by
Compute-Runtime-Automation

parent
88fe22fc49
commit
410fd7d909
@ -32,6 +32,10 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandListAppendLaunchKernel, givenFunctionWhenBind
|
|||||||
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
using MEDIA_INTERFACE_DESCRIPTOR_LOAD = typename FamilyType::MEDIA_INTERFACE_DESCRIPTOR_LOAD;
|
||||||
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
using INTERFACE_DESCRIPTOR_DATA = typename FamilyType::INTERFACE_DESCRIPTOR_DATA;
|
||||||
|
|
||||||
|
for (auto debugKey : {-1, 0, 1}) {
|
||||||
|
DebugManagerStateRestore restore;
|
||||||
|
DebugManager.flags.ForceBtpPrefetchMode.set(debugKey);
|
||||||
|
|
||||||
createKernel();
|
createKernel();
|
||||||
|
|
||||||
ze_group_count_t groupCount{1, 1, 1};
|
ze_group_count_t groupCount{1, 1, 1};
|
||||||
@ -61,6 +65,7 @@ HWCMDTEST_F(IGFX_GEN8_CORE, CommandListAppendLaunchKernel, givenFunctionWhenBind
|
|||||||
EXPECT_EQ(0u, idd->getBindingTableEntryCount());
|
EXPECT_EQ(0u, idd->getBindingTableEntryCount());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
HWCMDTEST_F(IGFX_GEN8_CORE, CommandListAppendLaunchKernel, givenEventsWhenAppendingKernelThenPostSyncToEventIsGenerated) {
|
HWCMDTEST_F(IGFX_GEN8_CORE, CommandListAppendLaunchKernel, givenEventsWhenAppendingKernelThenPostSyncToEventIsGenerated) {
|
||||||
using GPGPU_WALKER = typename FamilyType::GPGPU_WALKER;
|
using GPGPU_WALKER = typename FamilyType::GPGPU_WALKER;
|
||||||
|
@ -251,10 +251,9 @@ size_t HardwareCommandsHelper<GfxFamily>::sendIndirectState(
|
|||||||
|
|
||||||
uint64_t offsetInterfaceDescriptor = offsetInterfaceDescriptorTable + interfaceDescriptorIndex * sizeof(INTERFACE_DESCRIPTOR_DATA);
|
uint64_t offsetInterfaceDescriptor = offsetInterfaceDescriptorTable + interfaceDescriptorIndex * sizeof(INTERFACE_DESCRIPTOR_DATA);
|
||||||
|
|
||||||
auto bindingTablePrefetchSize = std::min(31u, static_cast<uint32_t>(kernel.getNumberOfBindingTableStates()));
|
auto bindingTablePrefetchSize = 0;
|
||||||
|
if (EncodeSurfaceState<GfxFamily>::doBindingTablePrefetch()) {
|
||||||
if (!EncodeSurfaceState<GfxFamily>::doBindingTablePrefetch()) {
|
bindingTablePrefetchSize = std::min(31u, static_cast<uint32_t>(kernel.getNumberOfBindingTableStates()));
|
||||||
bindingTablePrefetchSize = 0;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
HardwareCommandsHelper<GfxFamily>::sendInterfaceDescriptorData(
|
HardwareCommandsHelper<GfxFamily>::sendInterfaceDescriptorData(
|
||||||
|
@ -304,6 +304,7 @@ struct EncodeSurfaceState {
|
|||||||
|
|
||||||
static void getSshAlignedPointer(uintptr_t &ptr, size_t &offset);
|
static void getSshAlignedPointer(uintptr_t &ptr, size_t &offset);
|
||||||
static bool doBindingTablePrefetch();
|
static bool doBindingTablePrefetch();
|
||||||
|
static bool isBindingTablePrefetchPreferred();
|
||||||
|
|
||||||
static size_t pushBindingTableAndSurfaceStates(IndirectHeap &dstHeap, size_t bindingTableCount,
|
static size_t pushBindingTableAndSurfaceStates(IndirectHeap &dstHeap, size_t bindingTableCount,
|
||||||
const void *srcKernelSsh, size_t srcKernelSshSize,
|
const void *srcKernelSsh, size_t srcKernelSshSize,
|
||||||
|
@ -675,12 +675,18 @@ void EncodeIndirectParams<Family>::setWorkDimIndirect(CommandContainer &containe
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
template <typename Family>
|
||||||
|
bool EncodeSurfaceState<Family>::doBindingTablePrefetch() {
|
||||||
|
auto enableBindingTablePrefetech = isBindingTablePrefetchPreferred();
|
||||||
|
if (DebugManager.flags.ForceBtpPrefetchMode.get() != -1) {
|
||||||
|
enableBindingTablePrefetech = static_cast<bool>(DebugManager.flags.ForceBtpPrefetchMode.get());
|
||||||
|
}
|
||||||
|
return enableBindingTablePrefetech;
|
||||||
|
}
|
||||||
|
|
||||||
template <typename Family>
|
template <typename Family>
|
||||||
void EncodeDispatchKernel<Family>::adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) {
|
void EncodeDispatchKernel<Family>::adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) {
|
||||||
auto enablePrefetch = EncodeSurfaceState<Family>::doBindingTablePrefetch();
|
auto enablePrefetch = EncodeSurfaceState<Family>::doBindingTablePrefetch();
|
||||||
if (DebugManager.flags.ForceBtpPrefetchMode.get() != -1) {
|
|
||||||
enablePrefetch = static_cast<bool>(DebugManager.flags.ForceBtpPrefetchMode.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enablePrefetch) {
|
if (enablePrefetch) {
|
||||||
interfaceDescriptor.setSamplerCount(static_cast<typename INTERFACE_DESCRIPTOR_DATA::SAMPLER_COUNT>((samplerCount + 3) / 4));
|
interfaceDescriptor.setSamplerCount(static_cast<typename INTERFACE_DESCRIPTOR_DATA::SAMPLER_COUNT>((samplerCount + 3) / 4));
|
||||||
|
@ -482,7 +482,7 @@ inline void EncodeSurfaceState<GfxFamily>::encodeExtraBufferParams(EncodeSurface
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename GfxFamily>
|
template <typename GfxFamily>
|
||||||
bool EncodeSurfaceState<GfxFamily>::doBindingTablePrefetch() {
|
bool EncodeSurfaceState<GfxFamily>::isBindingTablePrefetchPreferred() {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -628,7 +628,7 @@ size_t EncodeMiFlushDW<Family>::getMiFlushDwWaSize() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <typename Family>
|
template <typename Family>
|
||||||
bool EncodeSurfaceState<Family>::doBindingTablePrefetch() {
|
bool EncodeSurfaceState<Family>::isBindingTablePrefetchPreferred() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@ using Family = NEO::Gen11Family;
|
|||||||
namespace NEO {
|
namespace NEO {
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool EncodeSurfaceState<Family>::doBindingTablePrefetch() {
|
bool EncodeSurfaceState<Family>::isBindingTablePrefetchPreferred() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -83,7 +83,7 @@ void EncodeSurfaceState<Family>::encodeExtraBufferParams(EncodeSurfaceStateArgs
|
|||||||
}
|
}
|
||||||
|
|
||||||
template <>
|
template <>
|
||||||
bool EncodeSurfaceState<Family>::doBindingTablePrefetch() {
|
bool EncodeSurfaceState<Family>::isBindingTablePrefetchPreferred() {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -297,9 +297,6 @@ void EncodeDispatchKernel<Family>::appendAdditionalIDDFields(INTERFACE_DESCRIPTO
|
|||||||
template <>
|
template <>
|
||||||
void EncodeDispatchKernel<Family>::adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) {
|
void EncodeDispatchKernel<Family>::adjustBindingTablePrefetch(INTERFACE_DESCRIPTOR_DATA &interfaceDescriptor, uint32_t samplerCount, uint32_t bindingTableEntryCount) {
|
||||||
auto enablePrefetch = EncodeSurfaceState<Family>::doBindingTablePrefetch();
|
auto enablePrefetch = EncodeSurfaceState<Family>::doBindingTablePrefetch();
|
||||||
if (DebugManager.flags.ForceBtpPrefetchMode.get() != -1) {
|
|
||||||
enablePrefetch = static_cast<bool>(DebugManager.flags.ForceBtpPrefetchMode.get());
|
|
||||||
}
|
|
||||||
|
|
||||||
if (enablePrefetch) {
|
if (enablePrefetch) {
|
||||||
interfaceDescriptor.setBindingTableEntryCount(std::min(bindingTableEntryCount, 31u));
|
interfaceDescriptor.setBindingTableEntryCount(std::min(bindingTableEntryCount, 31u));
|
||||||
|
Reference in New Issue
Block a user