Skip to content

Commit 51d34da

Browse files
committed
Add multiEngineQueue field to DispatchFlags and modify interfaces
Change-Id: Iaa4754a22e9b88201aed7df01c7d6e5fd06c84a9
1 parent 12245bc commit 51d34da

File tree

10 files changed

+42
-14
lines changed

10 files changed

+42
-14
lines changed

runtime/command_queue/enqueue_common.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -611,6 +611,7 @@ CompletionStamp CommandQueueHw<GfxFamily>::enqueueNonBlocked(
611611
}
612612
dispatchFlags.numGrfRequired = numGrfRequired;
613613
dispatchFlags.specialPipelineSelectMode = specialPipelineSelectMode;
614+
dispatchFlags.multiEngineQueue = this->multiEngineQueue;
614615
DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady);
615616

616617
if (gtpinIsGTPinInitialized()) {

runtime/command_stream/command_stream_receiver_hw.inl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -326,7 +326,8 @@ CompletionStamp CommandStreamReceiverHw<GfxFamily>::flushTask(
326326
newGSHbase,
327327
requiredL3Index,
328328
getMemoryManager()->getInternalHeapBaseAddress(),
329-
device.getGmmHelper());
329+
device.getGmmHelper(),
330+
dispatchFlags);
330331

331332
if (sshDirty) {
332333
StateBaseAddressHelper<GfxFamily>::programBindingTableBaseAddress(commandStreamCSR, ssh, stateBaseAddressCmdOffset,

runtime/command_stream/csr_definitions.h

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ constexpr int64_t maxTimeout = std::numeric_limits<int64_t>::max();
3131
}
3232

3333
struct DispatchFlags {
34+
CsrDependencies csrDependencies;
35+
FlushStampTrackingObj *flushStampReference = nullptr;
36+
QueueThrottle throttle = QueueThrottle::MEDIUM;
37+
PreemptionMode preemptionMode = PreemptionMode::Disabled;
38+
uint32_t numGrfRequired = GrfConfig::DefaultGrfNumber;
3439
bool blocking = false;
3540
bool dcFlush = false;
3641
bool useSLM = false;
@@ -39,14 +44,10 @@ struct DispatchFlags {
3944
bool mediaSamplerRequired = false;
4045
bool requiresCoherency = false;
4146
bool lowPriority = false;
42-
QueueThrottle throttle = QueueThrottle::MEDIUM;
4347
bool implicitFlush = false;
4448
bool outOfOrderExecutionAllowed = false;
45-
FlushStampTrackingObj *flushStampReference = nullptr;
46-
PreemptionMode preemptionMode = PreemptionMode::Disabled;
47-
CsrDependencies csrDependencies;
48-
uint32_t numGrfRequired = GrfConfig::DefaultGrfNumber;
4949
bool specialPipelineSelectMode = false;
50+
bool multiEngineQueue = false;
5051
};
5152

5253
struct CsrSizeRequestFlags {

runtime/helpers/properties_helper.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2018 Intel Corporation
2+
* Copyright (C) 2018-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -15,7 +15,7 @@ namespace OCLRT {
1515
class MemObj;
1616
class Buffer;
1717

18-
enum class QueueThrottle {
18+
enum QueueThrottle : uint32_t {
1919
LOW,
2020
MEDIUM,
2121
HIGH

runtime/helpers/state_base_address.h

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ namespace OCLRT {
1414
class GmmHelper;
1515
class IndirectHeap;
1616
class LinearStream;
17+
struct DispatchFlags;
1718

1819
template <typename GfxFamily>
1920
struct StateBaseAddressHelper {
@@ -27,7 +28,8 @@ struct StateBaseAddressHelper {
2728
uint64_t generalStateBase,
2829
uint32_t statelessMocsIndex,
2930
uint64_t internalHeapBase,
30-
GmmHelper *gmmHelper);
31+
GmmHelper *gmmHelper,
32+
DispatchFlags &dispatchFlags);
3133

3234
static void appendStateBaseAddressParameters(
3335
STATE_BASE_ADDRESS *stateBaseAddress,
@@ -36,7 +38,8 @@ struct StateBaseAddressHelper {
3638
const IndirectHeap &ssh,
3739
uint64_t generalStateBase,
3840
uint64_t internalHeapBase,
39-
GmmHelper *gmmHelper);
41+
GmmHelper *gmmHelper,
42+
DispatchFlags &dispatchFlags);
4043

4144
static void programBindingTableBaseAddress(LinearStream &commandStream, const IndirectHeap &ssh, size_t stateBaseAddressCmdOffset,
4245
GmmHelper *gmmHelper);

runtime/helpers/state_base_address.inl

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
2222
uint64_t generalStateBase,
2323
uint32_t statelessMocsIndex,
2424
uint64_t internalHeapBase,
25-
GmmHelper *gmmHelper) {
25+
GmmHelper *gmmHelper,
26+
DispatchFlags &dispatchFlags) {
2627

2728
auto pCmd = static_cast<STATE_BASE_ADDRESS *>(commandStream.getSpace(sizeof(STATE_BASE_ADDRESS)));
2829
*pCmd = GfxFamily::cmdInitStateBaseAddress;
@@ -57,7 +58,7 @@ void StateBaseAddressHelper<GfxFamily>::programStateBaseAddress(
5758
pCmd->setStatelessDataPortAccessMemoryObjectControlState(gmmHelper->getMOCS(statelessMocsIndex));
5859
pCmd->setInstructionMemoryObjectControlState(gmmHelper->getMOCS(GMM_RESOURCE_USAGE_OCL_STATE_HEAP_BUFFER));
5960

60-
appendStateBaseAddressParameters(pCmd, dsh, ioh, ssh, generalStateBase, internalHeapBase, gmmHelper);
61+
appendStateBaseAddressParameters(pCmd, dsh, ioh, ssh, generalStateBase, internalHeapBase, gmmHelper, dispatchFlags);
6162
}
6263

6364
template <typename GfxFamily>
@@ -68,7 +69,8 @@ void StateBaseAddressHelper<GfxFamily>::appendStateBaseAddressParameters(
6869
const IndirectHeap &ssh,
6970
uint64_t generalStateBase,
7071
uint64_t internalHeapBase,
71-
GmmHelper *gmmHelper) {
72+
GmmHelper *gmmHelper,
73+
DispatchFlags &dispatchFlags) {
7274
}
7375

7476
template <typename GfxFamily>

runtime/helpers/task_information.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@ CompletionStamp &CommandMapUnmap::submit(uint32_t taskLevel, bool terminated) {
6262
dispatchFlags.lowPriority = cmdQ.getPriority() == QueuePriority::LOW;
6363
dispatchFlags.throttle = cmdQ.getThrottle();
6464
dispatchFlags.preemptionMode = PreemptionHelper::taskPreemptionMode(cmdQ.getDevice(), nullptr);
65+
dispatchFlags.multiEngineQueue = cmdQ.isMultiEngineQueue();
6566

6667
DEBUG_BREAK_IF(taskLevel >= Event::eventNotReady);
6768

@@ -212,6 +213,8 @@ CompletionStamp &CommandComputeKernel::submit(uint32_t taskLevel, bool terminate
212213
dispatchFlags.throttle = commandQueue.getThrottle();
213214
dispatchFlags.preemptionMode = preemptionMode;
214215
dispatchFlags.mediaSamplerRequired = kernel->isVmeKernel();
216+
dispatchFlags.multiEngineQueue = commandQueue.isMultiEngineQueue();
217+
215218
if (commandStreamReceiver.peekTimestampPacketWriteEnabled()) {
216219
dispatchFlags.csrDependencies.fillFromEventsRequestAndMakeResident(eventsRequest, commandStreamReceiver, CsrDependencies::DependenciesType::OutOfCsr);
217220
}

runtime/mem_obj/buffer.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -163,6 +163,7 @@ class BufferHw : public Buffer {
163163
zeroCopy, isHostPtrSVM, isObjectRedescribed) {}
164164

165165
void setArgStateful(void *memory, bool forceNonAuxMode, bool disableL3Cache) override;
166+
void appendBufferState(void *memory, Context *context, GraphicsAllocation *gfxAllocation);
166167

167168
static Buffer *create(Context *context,
168169
MemoryProperties properties,

runtime/mem_obj/buffer.inl

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,5 +87,11 @@ void BufferHw<GfxFamily>::setArgStateful(void *memory, bool forceNonAuxMode, boo
8787
surfaceState->setCoherencyType(RENDER_SURFACE_STATE::COHERENCY_TYPE_IA_COHERENT);
8888
surfaceState->setAuxiliarySurfaceMode(AUXILIARY_SURFACE_MODE::AUXILIARY_SURFACE_MODE_AUX_NONE);
8989
}
90+
91+
appendBufferState(memory, context, getGraphicsAllocation());
92+
}
93+
94+
template <typename GfxFamily>
95+
void BufferHw<GfxFamily>::appendBufferState(void *memory, Context *context, GraphicsAllocation *gfxAllocation) {
9096
}
9197
} // namespace OCLRT

unit_tests/command_stream/command_stream_receiver_flush_task_2_tests.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
*/
77

88
#include "reg_configs_common.h"
9+
#include "runtime/command_stream/csr_definitions.h"
910
#include "runtime/helpers/hw_helper.h"
1011
#include "runtime/gmm_helper/gmm_helper.h"
1112
#include "runtime/helpers/state_base_address.h"
@@ -980,8 +981,17 @@ HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrInNonDirtyStateAndBatching
980981
HWTEST_F(CommandStreamReceiverFlushTaskTests, givenCsrWhenGeneralStateBaseAddressIsProgrammedThenDecanonizedAddressIsWritten) {
981982
uint64_t generalStateBaseAddress = 0xffff800400010000ull;
982983
StateBaseAddressHelper<FamilyType> helper;
984+
DispatchFlags dispatchFlags;
983985

984-
helper.programStateBaseAddress(commandStream, dsh, ioh, ssh, generalStateBaseAddress, 0, generalStateBaseAddress, pDevice->getGmmHelper());
986+
helper.programStateBaseAddress(commandStream,
987+
dsh,
988+
ioh,
989+
ssh,
990+
generalStateBaseAddress,
991+
0,
992+
generalStateBaseAddress,
993+
pDevice->getGmmHelper(),
994+
dispatchFlags);
985995

986996
HardwareParse hwParser;
987997
hwParser.parseCommands<FamilyType>(commandStream);

0 commit comments

Comments
 (0)