Debug option to flatten main and chained batch buffer in AUB dump.

New debug option FlattenBatchBufferForAUBDump has been added. When set it
modifies AUB dump in such way that commands from main and chained batch
buffer are dumped as single allocation. Commands from chained batch buffer are
dumped directly after commands from main batch buffer without
MI_BATCH_BUFFER_START. This feature also requires ImmediateDispatch mode which
can be forced using debug option CsrDispatchMode = 1.

Change-Id: I730760791693a748e7f4e1463ce8e7af94287b93
This commit is contained in:
Pawel Wilma
2018-02-28 22:50:41 +01:00
committed by sys_ocldev
parent 5ab43a9757
commit c4c35955d1
14 changed files with 320 additions and 94 deletions

View File

@@ -27,6 +27,7 @@
#include "unit_tests/fixtures/hello_world_fixture.h"
#include "unit_tests/fixtures/simple_arg_fixture.h"
#include "unit_tests/fixtures/two_walker_fixture.h"
#include "unit_tests/helpers/debug_manager_state_restore.h"
#include "test.h"
using namespace OCLRT;
@@ -267,6 +268,33 @@ HWTEST_F(AUBSimpleArg, simple) {
EXPECT_EQ(0, memcmp(pISA, pExpectedISA, expectedSize));
}
HWTEST_F(AUBSimpleArg, givenAubCommandStreamerReceiverWhenBatchBufferFlateningIsForcedThenDumpedAubIsStillValid) {
cl_uint workDim = 1;
size_t globalWorkOffset[3] = {0, 0, 0};
size_t globalWorkSize[3] = {1, 1, 1};
size_t localWorkSize[3] = {1, 1, 1};
cl_uint numEventsInWaitList = 0;
cl_event *eventWaitList = nullptr;
cl_event *event = nullptr;
DebugManagerStateRestore dbgRestore;
DebugManager.flags.FlattenBatchBufferForAUBDump.set(true);
pCmdQ->getDevice().getCommandStreamReceiver().overrideDispatchPolicy(CommandStreamReceiver::DispatchMode::ImmediateDispatch);
auto retVal = pCmdQ->enqueueKernel(
pKernel,
workDim,
globalWorkOffset,
globalWorkSize,
localWorkSize,
numEventsInWaitList,
eventWaitList,
event);
ASSERT_EQ(CL_SUCCESS, retVal);
}
struct AUBSimpleArgIntegrateTest : public SimpleArgFixture<AUBSimpleArgFixtureFactory>,
public ::testing::TestWithParam<std::tuple<uint32_t /*cl_uint*/, TestParam>> {
typedef SimpleArgFixture<AUBSimpleArgFixtureFactory> ParentClass;