mirror of
https://github.com/intel/compute-runtime.git
synced 2025-09-15 13:01:45 +08:00
Fix debug surface allocation in multi-queue scenarios
Related-To: NEO-5078 Change-Id: Ife48e703f348340cd8f89dd76f8affce0641adac Signed-off-by: Konstanty Misiak <konstanty.misiak@intel.com>
This commit is contained in:

committed by
sys_ocldev

parent
1f240862ce
commit
dcc5316d88
@ -74,7 +74,7 @@ class CommandQueueHw : public CommandQueue {
|
||||
getGpgpuCommandStreamReceiver().enableNTo1SubmissionModel();
|
||||
}
|
||||
|
||||
if (device->getDevice().getDebugger()) {
|
||||
if (device->getDevice().getDebugger() && !getGpgpuCommandStreamReceiver().getDebugSurfaceAllocation()) {
|
||||
getGpgpuCommandStreamReceiver().allocateDebugSurface(SipKernel::maxDbgSurfaceSize);
|
||||
}
|
||||
|
||||
|
@ -6,6 +6,7 @@
|
||||
*/
|
||||
|
||||
#include "shared/test/unit_test/helpers/debug_manager_state_restore.h"
|
||||
#include "shared/test/unit_test/mocks/mock_os_library.h"
|
||||
#include "shared/test/unit_test/utilities/base_object_utils.h"
|
||||
|
||||
#include "opencl/source/built_ins/builtins_dispatch_builder.h"
|
||||
@ -23,6 +24,7 @@
|
||||
#include "opencl/test/unit_test/mocks/mock_csr.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_event.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_kernel.h"
|
||||
#include "opencl/test/unit_test/mocks/mock_source_level_debugger.h"
|
||||
#include "test.h"
|
||||
|
||||
using namespace NEO;
|
||||
@ -78,6 +80,21 @@ struct OOQueueHwTest : public ClDeviceFixture,
|
||||
}
|
||||
};
|
||||
|
||||
HWTEST_F(CommandQueueHwTest, WhenConstructingTwoCommandQueuesThenOnlyOneDebugSurfaceIsAllocated) {
|
||||
ExecutionEnvironment *executionEnvironment = platform()->peekExecutionEnvironment();
|
||||
executionEnvironment->rootDeviceEnvironments[0]->debugger.reset(new MockActiveSourceLevelDebugger(new MockOsLibrary));
|
||||
|
||||
auto device = std::make_unique<MockClDevice>(MockDevice::create<MockDeviceWithDebuggerActive>(executionEnvironment, 0u));
|
||||
|
||||
MockCommandQueueHw<FamilyType> mockCmdQueueHw1(context, device.get(), nullptr);
|
||||
|
||||
auto dbgSurface = device->getGpgpuCommandStreamReceiver().getDebugSurfaceAllocation();
|
||||
EXPECT_NE(dbgSurface, nullptr);
|
||||
|
||||
MockCommandQueueHw<FamilyType> mockCmdQueueHw2(context, device.get(), nullptr);
|
||||
EXPECT_EQ(dbgSurface, device->getGpgpuCommandStreamReceiver().getDebugSurfaceAllocation());
|
||||
}
|
||||
|
||||
HWTEST_F(CommandQueueHwTest, WhenEnqueuingBlockedMapUnmapOperationThenVirtualEventIsCreated) {
|
||||
|
||||
CommandQueueHw<FamilyType> *pHwQ = reinterpret_cast<CommandQueueHw<FamilyType> *>(pCmdQ);
|
||||
|
Reference in New Issue
Block a user