feature: unregister CSR client on Event host synchronize

Related-To: NEO-7458

Signed-off-by: Dunajski, Bartosz <bartosz.dunajski@intel.com>
This commit is contained in:
Dunajski, Bartosz
2023-06-22 16:38:44 +00:00
committed by Compute-Runtime-Automation
parent 61fb19caab
commit aea5f435db
10 changed files with 145 additions and 6 deletions

View File

@@ -53,9 +53,7 @@ CommandQueueImp::CommandQueueImp(Device *device, NEO::CommandStreamReceiver *csr
}
ze_result_t CommandQueueImp::destroy() {
if (this->clientId != CommandQueue::clientNotRegistered) {
this->csr->unregisterClient();
}
unregisterCsrClient();
if (commandStream.getCpuBase() != nullptr) {
commandStream.replaceGraphicsAllocation(nullptr);
@@ -252,6 +250,13 @@ CommandQueue *CommandQueue::create(uint32_t productFamily, Device *device, NEO::
return commandQueue;
}
void CommandQueueImp::unregisterCsrClient() {
if (getClientId() != CommandQueue::clientNotRegistered) {
this->csr->unregisterClient();
setClientId(CommandQueue::clientNotRegistered);
}
}
ze_command_queue_mode_t CommandQueueImp::getSynchronousMode() const {
return desc.mode;
}

View File

@@ -60,8 +60,9 @@ struct CommandQueue : _ze_command_queue_handle_t {
bool peekIsCopyOnlyCommandQueue() const { return this->isCopyOnlyCommandQueue; }
uint32_t getClientId() { return this->clientId; }
uint32_t getClientId() const { return this->clientId; }
void setClientId(uint32_t value) { this->clientId = value; }
virtual void unregisterCsrClient() = 0;
static constexpr uint32_t clientNotRegistered = std::numeric_limits<uint32_t>::max();

View File

@@ -91,6 +91,7 @@ struct CommandQueueImp : public CommandQueue {
void makeResidentAndMigrate(bool performMigration, const NEO::ResidencyContainer &residencyContainer) override;
void printKernelsPrintfOutput(bool hangDetected);
void checkAssert();
void unregisterCsrClient() override;
protected:
MOCKABLE_VIRTUAL NEO::SubmissionStatus submitBatchBuffer(size_t offset, NEO::ResidencyContainer &residencyContainer, void *endingCmdPtr,