Create GpgpuWalkerHelper class

Change-Id: Ia9aa7b816356aff57234b46ea3509b6bd9b7f14b
This commit is contained in:
Zdanowicz, Zbigniew
2018-03-30 17:57:51 +02:00
committed by sys_ocldev
parent d51f2cd1ec
commit b6b92ae808
34 changed files with 1209 additions and 646 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, Intel Corporation
* Copyright (c) 2017 - 2018, Intel Corporation
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -20,7 +20,7 @@
* OTHER DEALINGS IN THE SOFTWARE.
*/
#include "runtime/command_queue/dispatch_walker.h"
#include "runtime/command_queue/gpgpu_walker.h"
#include "runtime/command_queue/local_id_gen.h"
#include "runtime/device_queue/device_queue_hw.h"
#include "runtime/helpers/per_thread_data.h"

View File

@@ -53,19 +53,19 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDev
size_t executionModelDSHUsedBefore = pDevQueueHw->getIndirectHeap(IndirectHeap::DYNAMIC_STATE)->getUsed();
dispatchWalker<FamilyType>(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false);
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false);
size_t dshUsedAfter = pCmdQ->getIndirectHeap(IndirectHeap::DYNAMIC_STATE).getUsed();
EXPECT_EQ(0u, dshUsedAfter);
@@ -109,19 +109,19 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenDef
auto &ioh = pCmdQ->getIndirectHeap(IndirectHeap::INDIRECT_OBJECT);
dispatchWalker<FamilyType>(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false);
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false);
auto iohUsed = ioh.getUsed();
EXPECT_EQ(0u, iohUsed);
@@ -136,19 +136,19 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsNotBlockedThenSSH
MockMultiDispatchInfo multiDispatchInfo(pKernel);
dispatchWalker<FamilyType>(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false);
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false);
auto &ssh = pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE);
@@ -172,19 +172,19 @@ HWTEST_P(ParentKernelDispatchTest, givenParentKernelWhenQueueIsBlockedThenSSHSiz
MockMultiDispatchInfo multiDispatchInfo(pKernel);
dispatchWalker<FamilyType>(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
true); // blockQueue
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*pKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
true); // blockQueue
ASSERT_NE(nullptr, blockedCommandsData);
size_t minRequiredSize = KernelCommandsHelper<FamilyType>::getTotalSizeRequiredSSH(multiDispatchInfo);
@@ -269,19 +269,19 @@ HWTEST_F(MockParentKernelDispatch, GivenBlockedQueueWhenParentKernelIsDispatched
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
dispatchWalker<FamilyType>(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
true); // blockQueue
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
true); // blockQueue
ASSERT_NE(nullptr, blockedCommandsData);
@@ -302,19 +302,19 @@ HWTEST_F(MockParentKernelDispatch, GivenParentKernelWhenDispatchedThenMediaInter
const size_t globalOffsets[3] = {0, 0, 0};
const size_t workItems[3] = {1, 1, 1};
dispatchWalker<FamilyType>(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false); // blockQueue
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false); // blockQueue
LinearStream *commandStream = &pCmdQ->getCS(0);
@@ -358,19 +358,19 @@ HWTEST_F(MockParentKernelDispatch, GivenUsedSSHHeapWhenParentKernelIsDispatchedT
// If parent is not using SSH, then heap obtained has zero usage and the same buffer
ASSERT_EQ(0u, mockParentKernel->getKernelInfo().heapInfo.pKernelHeader->SurfaceStateHeapSize);
dispatchWalker<FamilyType>(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false); // blockQueue
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false); // blockQueue
EXPECT_EQ(0u, ssh.getUsed());
@@ -393,19 +393,19 @@ HWTEST_F(MockParentKernelDispatch, GivenNotUsedSSHHeapWhenParentKernelIsDispatch
auto *bufferMemory = ssh.getCpuBase();
dispatchWalker<FamilyType>(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false); // blockQueue
GpgpuWalkerHelper<FamilyType>::dispatchWalker(*pCmdQ,
*mockParentKernel,
1,
globalOffsets,
workItems,
nullptr,
0,
nullptr,
&blockedCommandsData,
nullptr,
nullptr,
pDevice->getPreemptionMode(),
false); // blockQueue
EXPECT_EQ(bufferMemory, ssh.getCpuBase());

View File

@@ -72,7 +72,7 @@ HWTEST_F(ExecutionModelSchedulerFixture, dispatchScheduler) {
LinearStream &commandStream = getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*pCmdQ, false, false, &scheduler);
pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, minRequiredSizeForSchedulerSSH);
dispatchScheduler<FamilyType>(
GpgpuWalkerHelper<FamilyType>::dispatchScheduler(
*pCmdQ,
*pDevQueueHw,
pDevice->getPreemptionMode(),
@@ -188,7 +188,7 @@ HWTEST_F(ExecutionModelSchedulerFixture, dispatchSchedulerDoesNotUseStandardCmdQ
getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*pCmdQ, false, false, &scheduler);
pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, minRequiredSizeForSchedulerSSH);
dispatchScheduler<FamilyType>(
GpgpuWalkerHelper<FamilyType>::dispatchScheduler(
*pCmdQ,
*pDevQueueHw,
pDevice->getPreemptionMode(),
@@ -219,7 +219,7 @@ HWTEST_F(ParentKernelCommandQueueFixture, dispatchSchedulerWithEarlyReturnSetToF
LinearStream &commandStream = getCommandStream<FamilyType, CL_COMMAND_NDRANGE_KERNEL>(*pCmdQ, false, false, &scheduler);
pCmdQ->getIndirectHeap(IndirectHeap::SURFACE_STATE, minRequiredSizeForSchedulerSSH);
dispatchScheduler<FamilyType>(
GpgpuWalkerHelper<FamilyType>::dispatchScheduler(
*pCmdQ,
mockDevQueue,
device->getPreemptionMode(),