mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-19 06:24:51 +08:00
refactor: remove not needed code.
Signed-off-by: Mrozek, Michal <michal.mrozek@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
bb9ffd616a
commit
3ded04341c
@@ -2335,37 +2335,6 @@ void Kernel::reconfigureKernel() {
|
||||
this->systolicPipelineSelectMode = kernelDescriptor.kernelAttributes.flags.usesSystolicPipelineSelectMode;
|
||||
}
|
||||
|
||||
bool Kernel::requiresCacheFlushCommand(const CommandQueue &commandQueue) const {
|
||||
if (false == GfxCoreHelper::cacheFlushAfterWalkerSupported(commandQueue.getDevice().getHardwareInfo())) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (debugManager.flags.EnableCacheFlushAfterWalkerForAllQueues.get() != -1) {
|
||||
return !!debugManager.flags.EnableCacheFlushAfterWalkerForAllQueues.get();
|
||||
}
|
||||
|
||||
bool cmdQueueRequiresCacheFlush = commandQueue.getRequiresCacheFlushAfterWalker();
|
||||
if (false == cmdQueueRequiresCacheFlush) {
|
||||
return false;
|
||||
}
|
||||
if (commandQueue.getGpgpuCommandStreamReceiver().isMultiOsContextCapable()) {
|
||||
return false;
|
||||
}
|
||||
bool isMultiDevice = commandQueue.getContext().containsMultipleSubDevices(commandQueue.getDevice().getRootDeviceIndex());
|
||||
if (false == isMultiDevice) {
|
||||
return false;
|
||||
}
|
||||
bool isDefaultContext = (commandQueue.getContext().peekContextType() == ContextType::CONTEXT_TYPE_DEFAULT);
|
||||
if (true == isDefaultContext) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (getProgram()->getGlobalSurface(commandQueue.getDevice().getRootDeviceIndex()) != nullptr) {
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void Kernel::updateAuxTranslationRequired() {
|
||||
if (CompressionSelector::allowStatelessCompression()) {
|
||||
if (hasDirectStatelessAccessToHostMemory() ||
|
||||
|
||||
@@ -326,8 +326,6 @@ class Kernel : public ReferenceTrackedObject<Kernel> {
|
||||
|
||||
std::unique_ptr<KernelObjsForAuxTranslation> fillWithKernelObjsForAuxTranslation();
|
||||
|
||||
MOCKABLE_VIRTUAL bool requiresCacheFlushCommand(const CommandQueue &commandQueue) const;
|
||||
|
||||
void setAuxTranslationDirection(AuxTranslationDirection auxTranslationDirection) {
|
||||
this->auxTranslationDirection = auxTranslationDirection;
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#
|
||||
# Copyright (C) 2018-2023 Intel Corporation
|
||||
# Copyright (C) 2018-2024 Intel Corporation
|
||||
#
|
||||
# SPDX-License-Identifier: MIT
|
||||
#
|
||||
@@ -16,7 +16,6 @@ set(IGDRCL_SRCS_tests_kernel
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_info_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_pipe_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_arg_svm_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_cache_flush_requirements_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_info_cl_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_image_arg_tests.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/kernel_immediate_arg_tests.cpp
|
||||
|
||||
@@ -1,179 +0,0 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "shared/test/common/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/common/helpers/variable_backup.h"
|
||||
#include "shared/test/common/mocks/mock_device.h"
|
||||
#include "shared/test/common/mocks/mock_graphics_allocation.h"
|
||||
#include "shared/test/common/test_macros/hw_test.h"
|
||||
|
||||
#include "opencl/test/unit_test/fixtures/cl_device_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/context_fixture.h"
|
||||
#include "opencl/test/unit_test/fixtures/platform_fixture.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_command_queue.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_context.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_program.h"
|
||||
|
||||
namespace NEO {
|
||||
|
||||
class KernelWithCacheFlushTests : public PlatformFixture, public testing::TestWithParam<std::tuple<const char *, const char *>> {
|
||||
public:
|
||||
void SetUp() override {
|
||||
}
|
||||
void TearDown() override {
|
||||
}
|
||||
void initializePlatform() {
|
||||
PlatformFixture::setUp();
|
||||
}
|
||||
void clearPlatform() {
|
||||
PlatformFixture::tearDown();
|
||||
}
|
||||
};
|
||||
TEST_F(KernelWithCacheFlushTests, givenDeviceWhichDoesntRequireCacheFlushWhenCheckIfKernelRequireFlushThenReturnedFalse) {
|
||||
initializePlatform();
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
MockCommandQueue queue(mockContext);
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(queue);
|
||||
EXPECT_FALSE(flushRequired);
|
||||
clearPlatform();
|
||||
}
|
||||
TEST_F(KernelWithCacheFlushTests, givenQueueWhichDoesntRequireCacheFlushWhenCheckIfKernelRequireFlushThenReturnedFalse) {
|
||||
initializePlatform();
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableCacheFlushAfterWalker.set(1);
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
MockCommandQueue queue(mockContext);
|
||||
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(queue);
|
||||
EXPECT_FALSE(flushRequired);
|
||||
clearPlatform();
|
||||
}
|
||||
TEST_F(KernelWithCacheFlushTests, givenCacheFlushForAllQueuesDisabledWhenCheckIfKernelRequireFlushThenReturnedFalse) {
|
||||
initializePlatform();
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableCacheFlushAfterWalker.set(1);
|
||||
debugManager.flags.EnableCacheFlushAfterWalkerForAllQueues.set(0);
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
MockCommandQueue queue(mockContext);
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(queue);
|
||||
|
||||
EXPECT_FALSE(flushRequired);
|
||||
clearPlatform();
|
||||
}
|
||||
HWTEST_F(KernelWithCacheFlushTests, givenCacheFlushForMultiEngineEnabledWhenCheckIfKernelRequireFlushThenReturnedFalse) {
|
||||
initializePlatform();
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableCacheFlushAfterWalker.set(1);
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&mockContext, device, nullptr);
|
||||
cmdQ->requiresCacheFlushAfterWalker = true;
|
||||
auto &ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> &>(cmdQ->getGpgpuCommandStreamReceiver());
|
||||
ultCsr.multiOsContextCapable = true;
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(*cmdQ.get());
|
||||
|
||||
EXPECT_FALSE(flushRequired);
|
||||
clearPlatform();
|
||||
}
|
||||
|
||||
HWTEST_F(KernelWithCacheFlushTests, givenCacheFlushForSingleDeviceProgramWhenCheckIfKernelRequireFlushThenReturnedFalse) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.CreateMultipleSubDevices.set(1);
|
||||
initializePlatform();
|
||||
debugManager.flags.EnableCacheFlushAfterWalker.set(1);
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&mockContext, device, nullptr);
|
||||
auto &ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> &>(cmdQ->getGpgpuCommandStreamReceiver());
|
||||
ultCsr.multiOsContextCapable = false;
|
||||
cmdQ->requiresCacheFlushAfterWalker = true;
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(*cmdQ.get());
|
||||
|
||||
EXPECT_FALSE(flushRequired);
|
||||
clearPlatform();
|
||||
}
|
||||
|
||||
HWTEST_F(KernelWithCacheFlushTests, givenCacheFlushForDefaultTypeContextWhenCheckIfKernelRequireFlushThenReturnedFalse) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableCacheFlushAfterWalker.set(1);
|
||||
uint32_t numDevices = 2;
|
||||
debugManager.flags.CreateMultipleSubDevices.set(numDevices);
|
||||
initializePlatform();
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&mockContext, device, nullptr);
|
||||
cmdQ->requiresCacheFlushAfterWalker = true;
|
||||
auto &ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> &>(cmdQ->getGpgpuCommandStreamReceiver());
|
||||
ultCsr.multiOsContextCapable = false;
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(*cmdQ.get());
|
||||
|
||||
EXPECT_FALSE(flushRequired);
|
||||
clearPlatform();
|
||||
}
|
||||
HWTEST_F(KernelWithCacheFlushTests, givenCacheFlushWithNullGlobalSurfaceWhenCheckIfKernelRequireFlushThenReturnedFalse) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableCacheFlushAfterWalker.set(1);
|
||||
uint32_t numDevices = 2;
|
||||
debugManager.flags.CreateMultipleSubDevices.set(numDevices);
|
||||
initializePlatform();
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
mockContext.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED;
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&mockContext, device, nullptr);
|
||||
cmdQ->requiresCacheFlushAfterWalker = true;
|
||||
auto &ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> &>(cmdQ->getGpgpuCommandStreamReceiver());
|
||||
ultCsr.multiOsContextCapable = false;
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(*cmdQ.get());
|
||||
|
||||
EXPECT_FALSE(flushRequired);
|
||||
clearPlatform();
|
||||
}
|
||||
HWTEST_F(KernelWithCacheFlushTests, givenCacheFlushWithGlobalSurfaceWhenCheckIfKernelRequireFlushThenReturnedTrue) {
|
||||
DebugManagerStateRestore dbgRestore;
|
||||
debugManager.flags.EnableCacheFlushAfterWalker.set(1);
|
||||
uint32_t numDevices = 2;
|
||||
debugManager.flags.CreateMultipleSubDevices.set(numDevices);
|
||||
initializePlatform();
|
||||
auto device = pPlatform->getClDevice(0);
|
||||
|
||||
auto mockKernel = std::make_unique<MockKernelWithInternals>(*device);
|
||||
MockContext mockContext(device);
|
||||
mockContext.contextType = ContextType::CONTEXT_TYPE_SPECIALIZED;
|
||||
|
||||
void *allocPtr = reinterpret_cast<void *>(static_cast<uintptr_t>(6 * MemoryConstants::pageSize));
|
||||
MockGraphicsAllocation globalAllocation{allocPtr, MemoryConstants::pageSize * 2};
|
||||
mockKernel->mockProgram->setGlobalSurface(&globalAllocation);
|
||||
|
||||
auto cmdQ = std::make_unique<MockCommandQueueHw<FamilyType>>(&mockContext, device, nullptr);
|
||||
cmdQ->requiresCacheFlushAfterWalker = true;
|
||||
auto &ultCsr = static_cast<UltCommandStreamReceiver<FamilyType> &>(cmdQ->getGpgpuCommandStreamReceiver());
|
||||
ultCsr.multiOsContextCapable = false;
|
||||
bool flushRequired = mockKernel->mockKernel->Kernel::requiresCacheFlushCommand(*cmdQ.get());
|
||||
|
||||
EXPECT_TRUE(flushRequired);
|
||||
mockKernel->mockProgram->setGlobalSurface(nullptr);
|
||||
clearPlatform();
|
||||
}
|
||||
} // namespace NEO
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2018-2023 Intel Corporation
|
||||
* Copyright (C) 2018-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -39,13 +39,6 @@ void MockKernel::getResidency(std::vector<Surface *> &dst) {
|
||||
getResidencyCalls++;
|
||||
Kernel::getResidency(dst);
|
||||
}
|
||||
bool MockKernel::requiresCacheFlushCommand(const CommandQueue &commandQueue) const {
|
||||
if (debugManager.flags.EnableCacheFlushAfterWalker.get() != -1) {
|
||||
return !!debugManager.flags.EnableCacheFlushAfterWalker.get();
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
cl_int MockKernel::setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc, uint32_t allocId) {
|
||||
++setArgSvmAllocCalls;
|
||||
|
||||
@@ -248,8 +248,6 @@ class MockKernel : public Kernel {
|
||||
|
||||
void setSystolicPipelineSelectMode(bool value) { systolicPipelineSelectMode = value; }
|
||||
|
||||
bool requiresCacheFlushCommand(const CommandQueue &commandQueue) const override;
|
||||
|
||||
cl_int setArgSvmAlloc(uint32_t argIndex, void *svmPtr, GraphicsAllocation *svmAlloc, uint32_t allocId) override;
|
||||
|
||||
uint32_t makeResidentCalls = 0;
|
||||
|
||||
Reference in New Issue
Block a user