mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 06:49:52 +08:00
Refactor of pipeline select programming
Adding new interface to cooperate with hw context state Simplify programming removing unnecessary functions Code optimization that stop using expensive call and instead stores configuration parameter Related-To: NEO-5019 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
2b13f8af6d
commit
218a98f7f7
@@ -6,6 +6,7 @@
|
||||
|
||||
target_sources(neo_shared_tests PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_container_fixture.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/command_container_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/direct_submission_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/front_window_fixture.cpp
|
||||
|
||||
66
shared/test/unit_test/fixtures/command_container_fixture.cpp
Normal file
66
shared/test/unit_test/fixtures/command_container_fixture.cpp
Normal file
@@ -0,0 +1,66 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/unit_test/fixtures/command_container_fixture.h"
|
||||
|
||||
#include "shared/source/os_interface/hw_info_config.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
void CommandEncodeStatesFixture::setUp() {
|
||||
DeviceFixture::setUp();
|
||||
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||
cmdContainer->initialize(pDevice, nullptr, true);
|
||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||
const auto &hwInfo = pDevice->getHardwareInfo();
|
||||
cmdContainer->systolicModeSupport = HwInfoConfig::get(hwInfo.platform.eProductFamily)->isSystolicModeConfigurable(hwInfo);
|
||||
}
|
||||
|
||||
void CommandEncodeStatesFixture::tearDown() {
|
||||
cmdContainer.reset();
|
||||
DeviceFixture::tearDown();
|
||||
}
|
||||
|
||||
EncodeDispatchKernelArgs CommandEncodeStatesFixture::createDefaultDispatchKernelArgs(Device *device,
|
||||
DispatchKernelEncoderI *dispatchInterface,
|
||||
const void *threadGroupDimensions,
|
||||
bool requiresUncachedMocs) {
|
||||
EncodeDispatchKernelArgs args{
|
||||
0, // eventAddress
|
||||
device, // device
|
||||
dispatchInterface, // dispatchInterface
|
||||
threadGroupDimensions, // threadGroupDimensions
|
||||
nullptr, // additionalCommands
|
||||
PreemptionMode::Disabled, // preemptionMode
|
||||
1, // partitionCount
|
||||
false, // isIndirect
|
||||
false, // isPredicate
|
||||
false, // isTimestampEvent
|
||||
requiresUncachedMocs, // requiresUncachedMocs
|
||||
false, // useGlobalAtomics
|
||||
false, // isInternal
|
||||
false, // isCooperative
|
||||
false, // isHostScopeSignalEvent
|
||||
false, // isKernelUsingSystemAllocation
|
||||
false, // isKernelDispatchedFromImmediateCmdList
|
||||
false // isRcs
|
||||
};
|
||||
|
||||
return args;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
void WalkerThreadFixture::setUp() {
|
||||
startWorkGroup[0] = startWorkGroup[1] = startWorkGroup[2] = 0u;
|
||||
numWorkGroups[0] = numWorkGroups[1] = numWorkGroups[2] = 1u;
|
||||
workGroupSizes[0] = 32u;
|
||||
workGroupSizes[1] = workGroupSizes[2] = 1u;
|
||||
simd = 32u;
|
||||
localIdDimensions = 3u;
|
||||
requiredWorkGroupOrder = 0u;
|
||||
}
|
||||
@@ -20,46 +20,13 @@ class CommandEncodeStatesFixture : public DeviceFixture {
|
||||
using CommandContainer::dirtyHeaps;
|
||||
};
|
||||
|
||||
void setUp() {
|
||||
DeviceFixture::setUp();
|
||||
cmdContainer = std::make_unique<MyMockCommandContainer>();
|
||||
cmdContainer->initialize(pDevice, nullptr, true);
|
||||
cmdContainer->setDirtyStateForAllHeaps(false);
|
||||
}
|
||||
void tearDown() {
|
||||
cmdContainer.reset();
|
||||
DeviceFixture::tearDown();
|
||||
}
|
||||
std::unique_ptr<MyMockCommandContainer> cmdContainer;
|
||||
KernelDescriptor descriptor;
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
EncodeDispatchKernelArgs createDefaultDispatchKernelArgs(Device *device,
|
||||
DispatchKernelEncoderI *dispatchInterface,
|
||||
const void *threadGroupDimensions,
|
||||
bool requiresUncachedMocs) {
|
||||
EncodeDispatchKernelArgs args{
|
||||
0, // eventAddress
|
||||
device, // device
|
||||
dispatchInterface, // dispatchInterface
|
||||
threadGroupDimensions, // threadGroupDimensions
|
||||
nullptr, // additionalCommands
|
||||
PreemptionMode::Disabled, // preemptionMode
|
||||
1, // partitionCount
|
||||
false, // isIndirect
|
||||
false, // isPredicate
|
||||
false, // isTimestampEvent
|
||||
requiresUncachedMocs, // requiresUncachedMocs
|
||||
false, // useGlobalAtomics
|
||||
false, // isInternal
|
||||
false, // isCooperative
|
||||
false, // isHostScopeSignalEvent
|
||||
false, // isKernelUsingSystemAllocation
|
||||
false, // isKernelDispatchedFromImmediateCmdList
|
||||
false // isRcs
|
||||
};
|
||||
|
||||
return args;
|
||||
}
|
||||
bool requiresUncachedMocs);
|
||||
|
||||
template <typename FamilyType>
|
||||
EncodeStateBaseAddressArgs<FamilyType> createDefaultEncodeStateBaseAddressArgs(
|
||||
@@ -75,20 +42,15 @@ class CommandEncodeStatesFixture : public DeviceFixture {
|
||||
false};
|
||||
return args;
|
||||
}
|
||||
|
||||
KernelDescriptor descriptor;
|
||||
std::unique_ptr<MyMockCommandContainer> cmdContainer;
|
||||
};
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
struct WalkerThreadFixture {
|
||||
void setUp() {
|
||||
startWorkGroup[0] = startWorkGroup[1] = startWorkGroup[2] = 0u;
|
||||
numWorkGroups[0] = numWorkGroups[1] = numWorkGroups[2] = 1u;
|
||||
workGroupSizes[0] = 32u;
|
||||
workGroupSizes[1] = workGroupSizes[2] = 1u;
|
||||
simd = 32u;
|
||||
localIdDimensions = 3u;
|
||||
requiredWorkGroupOrder = 0u;
|
||||
}
|
||||
void setUp();
|
||||
void tearDown() {}
|
||||
|
||||
uint32_t startWorkGroup[3];
|
||||
|
||||
Reference in New Issue
Block a user