Skip to content

Commit f7e0dec

Browse files
Improve capturing profiling timestamps
Change-Id: I3a568afb664cae5c871e53de2c36fc8be65a4bdf
1 parent ba2b8f0 commit f7e0dec

File tree

7 files changed

+23
-23
lines changed

7 files changed

+23
-23
lines changed

runtime/command_queue/gpgpu_walker.h

Lines changed: 5 additions & 1 deletion
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
*
@@ -28,6 +28,8 @@ namespace OCLRT {
2828

2929
template <typename GfxFamily>
3030
using WALKER_TYPE = typename GfxFamily::WALKER_TYPE;
31+
template <typename GfxFamily>
32+
using MI_STORE_REG_MEM = typename GfxFamily::MI_STORE_REGISTER_MEM_CMD;
3133

3234
constexpr int32_t NUM_ALU_INST_FOR_READ_MODIFY_WRITE = 4;
3335

@@ -206,6 +208,8 @@ class GpgpuWalkerHelper {
206208
WALKER_TYPE<GfxFamily> *walkerCmd,
207209
const Kernel &kernel,
208210
const DispatchInfo &dispatchInfo);
211+
212+
static void adjustMiStoreRegMemMode(MI_STORE_REG_MEM<GfxFamily> *storeCmd);
209213
};
210214

211215
template <typename GfxFamily>

runtime/command_queue/gpgpu_walker.inl

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -116,6 +116,7 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchProfilingCommandsStart(
116116
//low part
117117
auto pMICmdLow = (MI_STORE_REGISTER_MEM *)commandStream->getSpace(sizeof(MI_STORE_REGISTER_MEM));
118118
*pMICmdLow = MI_STORE_REGISTER_MEM::sInit();
119+
adjustMiStoreRegMemMode(pMICmdLow);
119120
pMICmdLow->setRegisterAddress(GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
120121
pMICmdLow->setMemoryAddress(TimeStampAddress);
121122
}
@@ -138,6 +139,7 @@ void GpgpuWalkerHelper<GfxFamily>::dispatchProfilingCommandsEnd(
138139
//low part
139140
auto pMICmdLow = (MI_STORE_REGISTER_MEM *)commandStream->getSpace(sizeof(MI_STORE_REGISTER_MEM));
140141
*pMICmdLow = MI_STORE_REGISTER_MEM::sInit();
142+
adjustMiStoreRegMemMode(pMICmdLow);
141143
pMICmdLow->setRegisterAddress(GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
142144
pMICmdLow->setMemoryAddress(TimeStampAddress);
143145
}
@@ -383,6 +385,10 @@ size_t GpgpuWalkerHelper<GfxFamily>::getSizeForWADisableLSQCROPERFforOCL(const K
383385
return (size_t)0;
384386
}
385387

388+
template <typename GfxFamily>
389+
void GpgpuWalkerHelper<GfxFamily>::adjustMiStoreRegMemMode(MI_STORE_REG_MEM<GfxFamily> *storeCmd) {
390+
}
391+
386392
template <typename GfxFamily>
387393
size_t EnqueueOperation<GfxFamily>::getTotalSizeRequiredCS(uint32_t eventType, cl_uint numEventsInWaitList, bool reserveProfilingCmdsSpace, bool reservePerfCounters, CommandQueue &commandQueue, const MultiDispatchInfo &multiDispatchInfo) {
388394
size_t expectedSizeCS = 0;

runtime/device_queue/device_queue_hw_profiling.inl

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,8 @@
11
/*
2-
* Copyright (c) 2017, Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
4-
* Permission is hereby granted, free of charge, to any person obtaining a
5-
* copy of this software and associated documentation files (the "Software"),
6-
* to deal in the Software without restriction, including without limitation
7-
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
* and/or sell copies of the Software, and to permit persons to whom the
9-
* Software is furnished to do so, subject to the following conditions:
4+
* SPDX-License-Identifier: MIT
105
*
11-
* The above copyright notice and this permission notice shall be included
12-
* in all copies or substantial portions of the Software.
13-
*
14-
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15-
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16-
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17-
* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
18-
* OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19-
* ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20-
* OTHER DEALINGS IN THE SOFTWARE.
216
*/
227

238
namespace OCLRT {
@@ -32,6 +17,7 @@ void DeviceQueueHw<GfxFamily>::addProfilingEndCmds(uint64_t timestampAddress) {
3217
//low part
3318
auto pMICmdLow = (MI_STORE_REGISTER_MEM *)slbCS.getSpace(sizeof(MI_STORE_REGISTER_MEM));
3419
*pMICmdLow = MI_STORE_REGISTER_MEM::sInit();
20+
GpgpuWalkerHelper<GfxFamily>::adjustMiStoreRegMemMode(pMICmdLow);
3521
pMICmdLow->setRegisterAddress(GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW);
3622
pMICmdLow->setMemoryAddress(timestampAddress);
3723
}

runtime/gen10/hw_cmds.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -26,6 +26,7 @@ struct CNLFamily : public GEN10 {
2626
using PARSE = CmdParse<CNLFamily>;
2727
using GfxFamily = CNLFamily;
2828
using WALKER_TYPE = GPGPU_WALKER;
29+
using MI_STORE_REGISTER_MEM_CMD = typename GfxFamily::MI_STORE_REGISTER_MEM;
2930
static const GPGPU_WALKER cmdInitGpgpuWalker;
3031
static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData;
3132
static const MEDIA_INTERFACE_DESCRIPTOR_LOAD cmdInitMediaInterfaceDescriptorLoad;

runtime/gen8/hw_cmds_base.h

Lines changed: 2 additions & 1 deletion
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
*
@@ -25,6 +25,7 @@ struct BDWFamily : public GEN8 {
2525
using PARSE = CmdParse<BDWFamily>;
2626
using GfxFamily = BDWFamily;
2727
using WALKER_TYPE = GPGPU_WALKER;
28+
using MI_STORE_REGISTER_MEM_CMD = typename GfxFamily::MI_STORE_REGISTER_MEM;
2829
static const GPGPU_WALKER cmdInitGpgpuWalker;
2930
static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData;
3031
static const MEDIA_INTERFACE_DESCRIPTOR_LOAD cmdInitMediaInterfaceDescriptorLoad;

runtime/gen9/hw_cmds_base.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (C) 2017-2018 Intel Corporation
2+
* Copyright (C) 2017-2019 Intel Corporation
33
*
44
* SPDX-License-Identifier: MIT
55
*
@@ -26,6 +26,7 @@ struct SKLFamily : public GEN9 {
2626
using PARSE = CmdParse<SKLFamily>;
2727
using GfxFamily = SKLFamily;
2828
using WALKER_TYPE = GPGPU_WALKER;
29+
using MI_STORE_REGISTER_MEM_CMD = typename GfxFamily::MI_STORE_REGISTER_MEM;
2930
static const GPGPU_WALKER cmdInitGpgpuWalker;
3031
static const INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData;
3132
static const MEDIA_INTERFACE_DESCRIPTOR_LOAD cmdInitMediaInterfaceDescriptorLoad;

unit_tests/libult/mock_gfx_family.h

Lines changed: 2 additions & 1 deletion
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
*
@@ -431,6 +431,7 @@ struct GENX {
431431
} MI_ATOMIC;
432432

433433
using WALKER_TYPE = GPGPU_WALKER;
434+
using MI_STORE_REGISTER_MEM_CMD = MI_STORE_REGISTER_MEM;
434435
static GPGPU_WALKER cmdInitGpgpuWalker;
435436
static INTERFACE_DESCRIPTOR_DATA cmdInitInterfaceDescriptorData;
436437
static MEDIA_STATE_FLUSH cmdInitMediaStateFlush;

0 commit comments

Comments
 (0)