mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-09 14:33:04 +08:00
remove magic numbers + add reg_global_timestamp to helper
Change-Id: I8a42139ef73586edc7f826750f7d6582e1750cad Signed-off-by: Kacper Nowak <kacper.nowak@intel.com>
This commit is contained in:
@@ -146,9 +146,6 @@ struct CommandListCoreFamily : CommandListImp {
|
||||
uint32_t srcSlicePitch, size_t srcOffset,
|
||||
ze_event_handle_t hSignalEvent, uint32_t numWaitEvents,
|
||||
ze_event_handle_t *phWaitEvents);
|
||||
static constexpr uint32_t alignIndirectStatePointer = MemoryConstants::cacheLineSize * sizeof(uint8_t);
|
||||
|
||||
static constexpr uint32_t regGlobalTimestamp = 0x2358;
|
||||
|
||||
ze_result_t appendLaunchFunctionWithParams(ze_kernel_handle_t hFunction,
|
||||
const ze_group_count_t *pThreadGroupDimensions,
|
||||
|
||||
@@ -10,6 +10,7 @@
|
||||
#include "shared/source/command_container/command_encoder.h"
|
||||
#include "shared/source/command_stream/linear_stream.h"
|
||||
#include "shared/source/command_stream/preemption.h"
|
||||
#include "shared/source/helpers/register_offsets.h"
|
||||
#include "shared/source/helpers/simd_helper.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/unified_memory/unified_memory.h"
|
||||
@@ -92,7 +93,7 @@ void CommandListCoreFamily<gfxCoreFamily>::appendEventForProfiling(ze_event_hand
|
||||
commandContainer.addToResidencyContainer(&event->getAllocation());
|
||||
if (beforeWalker) {
|
||||
timeStampAddress = event->getGpuAddress() + event->getOffsetOfProfilingEvent(ZE_EVENT_TIMESTAMP_GLOBAL_START);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(commandContainer, regGlobalTimestamp, timeStampAddress);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(commandContainer, REG_GLOBAL_TIMESTAMP_LDW, timeStampAddress);
|
||||
|
||||
timeStampAddress = event->getGpuAddress() + event->getOffsetOfProfilingEvent(ZE_EVENT_TIMESTAMP_CONTEXT_START);
|
||||
NEO::EncodeStoreMMIO<GfxFamily>::encode(commandContainer, GP_THREAD_TIME_REG_ADDRESS_OFFSET_LOW, timeStampAddress);
|
||||
|
||||
@@ -165,9 +165,9 @@ ze_result_t DeviceImp::getComputeProperties(ze_device_compute_properties_t *pCom
|
||||
pComputeProperties->maxGroupSizeY = static_cast<uint32_t>(deviceInfo.maxWorkItemSizes[1]);
|
||||
pComputeProperties->maxGroupSizeZ = static_cast<uint32_t>(deviceInfo.maxWorkItemSizes[2]);
|
||||
|
||||
pComputeProperties->maxGroupCountX = 0xffffffff;
|
||||
pComputeProperties->maxGroupCountY = 0xffffffff;
|
||||
pComputeProperties->maxGroupCountZ = 0xffffffff;
|
||||
pComputeProperties->maxGroupCountX = UINT32_MAX;
|
||||
pComputeProperties->maxGroupCountY = UINT32_MAX;
|
||||
pComputeProperties->maxGroupCountZ = UINT32_MAX;
|
||||
|
||||
pComputeProperties->maxSharedLocalMemory = static_cast<uint32_t>(deviceInfo.localMemSize);
|
||||
|
||||
|
||||
@@ -14,6 +14,7 @@
|
||||
#include "shared/source/execution_environment/execution_environment.h"
|
||||
#include "shared/source/execution_environment/root_device_environment.h"
|
||||
#include "shared/source/helpers/string.h"
|
||||
#include "shared/source/memory_manager/memory_constants.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/memory_manager/memory_operations_handler.h"
|
||||
#include "shared/source/utilities/cpuintrinsics.h"
|
||||
@@ -152,7 +153,7 @@ struct EventPoolImp : public EventPool {
|
||||
|
||||
protected:
|
||||
const uint32_t eventSize = 64u;
|
||||
const uint32_t eventAlignment = 64u;
|
||||
const uint32_t eventAlignment = MemoryConstants::cacheLineSize;
|
||||
|
||||
const uint32_t numEventTimestampTypes = 4u;
|
||||
};
|
||||
|
||||
@@ -8,6 +8,7 @@
|
||||
#include "level_zero/core/source/fence.h"
|
||||
|
||||
#include "shared/source/command_stream/command_stream_receiver.h"
|
||||
#include "shared/source/memory_manager/memory_constants.h"
|
||||
#include "shared/source/memory_manager/memory_manager.h"
|
||||
#include "shared/source/utilities/cpuintrinsics.h"
|
||||
|
||||
@@ -63,8 +64,8 @@ Fence *Fence::create(CommandQueueImp *cmdQueue, const ze_fence_desc_t *desc) {
|
||||
|
||||
bool FenceImp::initialize() {
|
||||
NEO::AllocationProperties properties(
|
||||
cmdQueue->getDevice()->getRootDeviceIndex(), 64u, NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
properties.alignment = 64u;
|
||||
cmdQueue->getDevice()->getRootDeviceIndex(), MemoryConstants::cacheLineSize, NEO::GraphicsAllocation::AllocationType::BUFFER_HOST_MEMORY);
|
||||
properties.alignment = MemoryConstants::cacheLineSize;
|
||||
allocation = cmdQueue->getDevice()->getDriverHandle()->getMemoryManager()->allocateGraphicsMemoryWithProperties(properties);
|
||||
UNRECOVERABLE_IF(allocation == nullptr);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user