feature: Add introspection APIs for cmdqueue

Added entrypoints for zeCommandQueueGetOrdinal and
zeCommandQueueGetIndex and implemented getOrdinal and getIndex
in command queue.

Related-To: NEO-10265
Signed-off-by: Yoon, Young Jin <young.jin.yoon@intel.com>
This commit is contained in:
Yoon, Young Jin
2024-02-03 11:55:02 +00:00
committed by Compute-Runtime-Automation
parent 9b649c1582
commit 7b12735ade
5 changed files with 98 additions and 5 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2023 Intel Corporation
* Copyright (C) 2020-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -356,4 +356,14 @@ void CommandQueueImp::makeResidentAndMigrate(bool performMigration, const NEO::R
}
}
ze_result_t CommandQueueImp::getOrdinal(uint32_t *pOrdinal) {
*pOrdinal = desc.ordinal;
return ZE_RESULT_SUCCESS;
}
ze_result_t CommandQueueImp::getIndex(uint32_t *pIndex) {
*pIndex = desc.index;
return ZE_RESULT_SUCCESS;
}
} // namespace L0

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2023 Intel Corporation
* Copyright (C) 2020-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -48,6 +48,8 @@ struct CommandQueue : _ze_command_queue_handle_t {
void *phCommands,
ze_fence_handle_t hFence) = 0;
virtual ze_result_t synchronize(uint64_t timeout) = 0;
virtual ze_result_t getOrdinal(uint32_t *pOrdinal) = 0;
virtual ze_result_t getIndex(uint32_t *pIndex) = 0;
static CommandQueue *create(uint32_t productFamily, Device *device, NEO::CommandStreamReceiver *csr,
const ze_command_queue_desc_t *desc, bool isCopyOnly, bool isInternal, bool immediateCmdListQueue, ze_result_t &resultValue);

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2020-2023 Intel Corporation
* Copyright (C) 2020-2024 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -78,6 +78,9 @@ struct CommandQueueImp : public CommandQueue {
ze_result_t initialize(bool copyOnly, bool isInternal, bool immediateCmdListQueue);
ze_result_t getOrdinal(uint32_t *pOrdinal) override;
ze_result_t getIndex(uint32_t *pIndex) override;
Device *getDevice() { return device; }
NEO::CommandStreamReceiver *getCsr() { return csr; }