Skip to content

Commit a0531c1

Browse files
Remove RMW pattern on gfx memory by using dedicated methods
Change-Id: Iedf7c1d15b3ee5b1aa713b5817005cb801c01956 Signed-off-by: Zbigniew Zdanowicz <[email protected]>
1 parent e7a1b53 commit a0531c1

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

opencl/source/command_queue/hardware_interface_base.inl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@
66
*/
77

88
#pragma once
9+
#include "shared/source/command_container/command_encoder.h"
10+
#include "shared/source/helpers/hw_helper.h"
911
#include "shared/source/helpers/pause_on_gpu_properties.h"
1012
#include "shared/source/memory_manager/internal_allocation_storage.h"
1113

@@ -15,6 +17,8 @@
1517
#include "opencl/source/helpers/task_information.h"
1618
#include "opencl/source/mem_obj/buffer.h"
1719

20+
#include "pipe_control_args.h"
21+
1822
namespace NEO {
1923

2024
template <typename GfxFamily>
@@ -297,27 +301,23 @@ inline void HardwareInterface<GfxFamily>::dispatchDebugPauseCommands(
297301
using PIPE_CONTROL = typename GfxFamily::PIPE_CONTROL;
298302
using POST_SYNC_OPERATION = typename PIPE_CONTROL::POST_SYNC_OPERATION;
299303

300-
auto pCmd = (PIPE_CONTROL *)commandStream->getSpace(sizeof(PIPE_CONTROL));
301-
*pCmd = GfxFamily::cmdInitPipeControl;
302-
303-
pCmd->setCommandStreamerStallEnable(true);
304-
pCmd->setDcFlushEnable(true);
305-
pCmd->setAddress(static_cast<uint32_t>(address & 0x0000FFFFFFFFULL));
306-
pCmd->setAddressHigh(static_cast<uint32_t>(address >> 32));
307-
pCmd->setPostSyncOperation(POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA);
308-
pCmd->setImmediateData(static_cast<uint32_t>(confirmationTrigger));
304+
PipeControlArgs args(true);
305+
MemorySynchronizationCommands<GfxFamily>::addPipeControlAndProgramPostSyncOperation(
306+
*commandStream,
307+
POST_SYNC_OPERATION::POST_SYNC_OPERATION_WRITE_IMMEDIATE_DATA,
308+
address,
309+
static_cast<uint64_t>(confirmationTrigger),
310+
commandQueue.getDevice().getHardwareInfo(),
311+
args);
309312
}
310313

311314
{
312315
using MI_SEMAPHORE_WAIT = typename GfxFamily::MI_SEMAPHORE_WAIT;
313-
314-
auto pCmd = (MI_SEMAPHORE_WAIT *)commandStream->getSpace(sizeof(MI_SEMAPHORE_WAIT));
315-
*pCmd = GfxFamily::cmdInitMiSemaphoreWait;
316-
317-
pCmd->setCompareOperation(MI_SEMAPHORE_WAIT::COMPARE_OPERATION::COMPARE_OPERATION_SAD_EQUAL_SDD);
318-
pCmd->setSemaphoreDataDword(static_cast<uint32_t>(waitCondition));
319-
pCmd->setSemaphoreGraphicsAddress(address);
320-
pCmd->setWaitMode(MI_SEMAPHORE_WAIT::WAIT_MODE::WAIT_MODE_POLLING_MODE);
316+
using COMPARE_OPERATION = typename GfxFamily::MI_SEMAPHORE_WAIT::COMPARE_OPERATION;
317+
EncodeSempahore<GfxFamily>::addMiSemaphoreWaitCommand(*commandStream,
318+
address,
319+
static_cast<uint32_t>(waitCondition),
320+
COMPARE_OPERATION::COMPARE_OPERATION_SAD_EQUAL_SDD);
321321
}
322322
}
323323
}

0 commit comments

Comments
 (0)