SWDEV-301667 - Cleanup unused paths
- Refactor code and cleanup logic for callback saving for event records Change-Id: I5c56aa8e9c968a5bca70fb07ad1796da318e9e89
This commit is contained in:
@@ -335,7 +335,6 @@ void Command::releaseResources() {
|
||||
}
|
||||
}
|
||||
|
||||
static constexpr uint32_t kMarkerTsCount = 1;
|
||||
// ================================================================================================
|
||||
void Command::enqueue() {
|
||||
assert(queue_ != NULL && "Cannot be enqueued");
|
||||
@@ -344,7 +343,8 @@ void Command::enqueue() {
|
||||
Agent::postEventCreate(as_cl(static_cast<Event*>(this)), type_);
|
||||
}
|
||||
|
||||
ClPrint(LOG_DEBUG, LOG_CMD, "Command (%s) enqueued: %p", getOclCommandKindString(this->type()), this);
|
||||
ClPrint(LOG_DEBUG, LOG_CMD, "Command (%s) enqueued: %p",
|
||||
getOclCommandKindString(this->type()), this);
|
||||
|
||||
// Direct dispatch logic below will submit the command immediately, but the command status
|
||||
// update will occur later after flush() with a wait
|
||||
@@ -362,21 +362,9 @@ void Command::enqueue() {
|
||||
ScopedLock sl(queue_->vdev()->execution());
|
||||
queue_->FormSubmissionBatch(this);
|
||||
|
||||
bool isMarker = (type() == CL_COMMAND_MARKER || type() == 0);
|
||||
if (isMarker) {
|
||||
if (type() == CL_COMMAND_MARKER || type() == 0) {
|
||||
// The current HSA signal tracking logic requires profiling enabled for the markers
|
||||
EnableProfiling();
|
||||
}
|
||||
|
||||
bool submitBatch = !profilingInfo().marker_ts_;
|
||||
// Flush the batch if ther marker_ts have been continuously submitted until a threashold
|
||||
// is reached. This helps recycling the commands and frees memory.
|
||||
if (queue_->GetMarkerTsCount() >= kMarkerTsCount) {
|
||||
submitBatch = true;
|
||||
queue_->ResetMarkerTsCount();
|
||||
}
|
||||
|
||||
if (isMarker && submitBatch) {
|
||||
// Update batch head for the current marker. Hence the status of all commands can be
|
||||
// updated upon the marker completion
|
||||
SetBatchHead(queue_->GetSubmittionBatch());
|
||||
@@ -394,6 +382,7 @@ void Command::enqueue() {
|
||||
queue_->append(*this);
|
||||
queue_->flush();
|
||||
}
|
||||
|
||||
if ((queue_->device().settings().waitCommand_ && (type_ != 0)) ||
|
||||
((commandWaitBits_ & 0x2) != 0)) {
|
||||
awaitCompletion();
|
||||
|
||||
@@ -40,8 +40,7 @@ HostQueue::HostQueue(Context& context, Device& device, cl_command_queue_properti
|
||||
lastEnqueueCommand_(nullptr),
|
||||
head_(nullptr),
|
||||
tail_(nullptr),
|
||||
isActive_(false),
|
||||
markerTsCount_(0) {
|
||||
isActive_(false) {
|
||||
if (GPU_FORCE_QUEUE_PROFILING) {
|
||||
properties().set(CL_QUEUE_PROFILING_ENABLE);
|
||||
}
|
||||
@@ -132,8 +131,7 @@ void HostQueue::finish(bool cpu_wait) {
|
||||
(command->NotifyEvent() != nullptr) ? command->NotifyEvent()->HwEvent() : command->HwEvent();
|
||||
force_marker = (hw_event == nullptr);
|
||||
}
|
||||
if (nullptr == command || force_marker ||
|
||||
vdev()->isHandlerPending() || vdev()->isFenceDirty()) {
|
||||
if (nullptr == command || force_marker || vdev()->isFenceDirty()) {
|
||||
if (nullptr != command) {
|
||||
command->release();
|
||||
}
|
||||
|
||||
@@ -264,9 +264,6 @@ class HostQueue : public CommandQueue {
|
||||
// an invalid access
|
||||
command->retain();
|
||||
|
||||
if (command->profilingInfo().marker_ts_) {
|
||||
markerTsCount_++;
|
||||
}
|
||||
// Release the last command in the batch
|
||||
if (lastEnqueueCommand_ != nullptr) {
|
||||
lastEnqueueCommand_->release();
|
||||
@@ -287,23 +284,14 @@ class HostQueue : public CommandQueue {
|
||||
//! Get queue status
|
||||
bool GetQueueStatus() { return isActive_; }
|
||||
|
||||
//! Get markerTsCount
|
||||
uint32_t GetMarkerTsCount() const { return markerTsCount_; }
|
||||
|
||||
//! Reset counter
|
||||
void ResetMarkerTsCount() { markerTsCount_ = 0; }
|
||||
|
||||
private:
|
||||
Command* head_; //!< Head of the batch list
|
||||
Command* tail_; //!< Tail of the batch list
|
||||
|
||||
//! True if this command queue is active
|
||||
bool isActive_;
|
||||
|
||||
uint32_t markerTsCount_; //!< Count of TS markers
|
||||
};
|
||||
|
||||
|
||||
class DeviceQueue : public CommandQueue {
|
||||
public:
|
||||
DeviceQueue(Context& context, //!< Context object
|
||||
|
||||
Reference in New Issue
Block a user