mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-25 13:33:02 +08:00
Introduce barrier tracking mechanism
Related-To: NEO-7696 Signed-off-by: Lukasz Jobczyk <lukasz.jobczyk@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6f3503af38
commit
9f574b6fba
@@ -743,6 +743,8 @@ bool CommandStreamReceiver::initializeTagAllocation() {
|
||||
userPauseConfirmation = Thread::create(CommandStreamReceiver::asyncDebugBreakConfirmation, reinterpret_cast<void *>(this));
|
||||
}
|
||||
|
||||
this->barrierCountTagAddress = ptrOffset(this->tagAddress, TagAllocationLayout::barrierCountOffset);
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1009,7 +1011,7 @@ TaskCountType CompletionStamp::getTaskCountFromSubmissionStatusError(SubmissionS
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
uint64_t CommandStreamReceiver::getBarrierCountGpuAddress() const { return ptrOffset(this->tagAllocation->getGpuAddress(), TagAllocationLayout::barrierCountOffset); }
|
||||
uint64_t CommandStreamReceiver::getDebugPauseStateGPUAddress() const { return tagAllocation->getGpuAddress() + TagAllocationLayout::debugPauseStateAddressOffset; }
|
||||
uint64_t CommandStreamReceiver::getCompletionAddress() const {
|
||||
uint64_t completionFenceAddress = castToUint64(const_cast<TagAddressType *>(tagAddress));
|
||||
|
||||
@@ -132,7 +132,11 @@ class CommandStreamReceiver {
|
||||
return tagsMultiAllocation;
|
||||
}
|
||||
MultiGraphicsAllocation &createTagsMultiAllocation();
|
||||
|
||||
TaskCountType getNextBarrierCount() { return this->barrierCount.fetch_add(1u); }
|
||||
volatile TagAddressType *getTagAddress() const { return tagAddress; }
|
||||
volatile TagAddressType *getBarrierCountTagAddress() const { return this->barrierCountTagAddress; }
|
||||
uint64_t getBarrierCountGpuAddress() const;
|
||||
uint64_t getDebugPauseStateGPUAddress() const;
|
||||
|
||||
virtual bool waitForFlushStamp(FlushStamp &flushStampToWait) { return true; }
|
||||
@@ -424,6 +428,7 @@ class CommandStreamReceiver {
|
||||
uint64_t totalMemoryUsed = 0u;
|
||||
|
||||
volatile TagAddressType *tagAddress = nullptr;
|
||||
volatile TagAddressType *barrierCountTagAddress = nullptr;
|
||||
volatile DebugPauseState *debugPauseStateAddress = nullptr;
|
||||
SpinLock debugPauseStateLock;
|
||||
static void *asyncDebugBreakConfirmation(void *arg);
|
||||
@@ -445,6 +450,7 @@ class CommandStreamReceiver {
|
||||
OsContext *osContext = nullptr;
|
||||
TaskCountType *completionFenceValuePointer = nullptr;
|
||||
|
||||
std::atomic<TaskCountType> barrierCount{0};
|
||||
// current taskLevel. Used for determining if a PIPE_CONTROL is needed.
|
||||
std::atomic<TaskCountType> taskLevel{0};
|
||||
std::atomic<TaskCountType> latestSentTaskCount{0};
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
* Copyright (C) 2022-2023 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -12,6 +12,6 @@ namespace NEO {
|
||||
namespace TagAllocationLayout {
|
||||
inline constexpr uint64_t debugPauseStateAddressOffset = MemoryConstants::kiloByte;
|
||||
inline constexpr uint64_t completionFenceOffset = 2 * MemoryConstants::kiloByte;
|
||||
|
||||
inline constexpr uint64_t barrierCountOffset = 3 * MemoryConstants::kiloByte;
|
||||
} // namespace TagAllocationLayout
|
||||
} // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user