mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 23:03:02 +08:00
Defer OsContext initialization
Signed-off-by: Maciej Dziuban <maciej.dziuban@intel.com> Related-To: NEO-5610
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
b01b8ba5ac
commit
5318ff1872
@@ -130,6 +130,7 @@ ze_result_t DeviceImp::createCommandQueue(const ze_command_queue_desc_t *desc,
|
||||
bool isCopyOnly = hwHelper.isCopyOnlyEngineType(static_cast<NEO::EngineGroupType>(engineGroupIndex));
|
||||
|
||||
*commandQueue = CommandQueue::create(platform.eProductFamily, this, csr, desc, isCopyOnly, false, returnValue);
|
||||
csr->getOsContext().ensureContextInitialized();
|
||||
|
||||
return returnValue;
|
||||
}
|
||||
|
||||
@@ -636,6 +636,24 @@ TEST_F(DeviceCreateCommandQueueTest, givenLowPriorityDescWhenCreateCommandQueueI
|
||||
commandQueue->destroy();
|
||||
}
|
||||
|
||||
TEST_F(DeviceCreateCommandQueueTest, givenLowPriorityEngineNotInitializedWhenCreateLowPriorityCommandQueueIsCalledThenEngineIsInitialized) {
|
||||
NEO::CommandStreamReceiver *lowPriorityCsr = nullptr;
|
||||
device->getCsrForLowPriority(&lowPriorityCsr);
|
||||
ASSERT_FALSE(lowPriorityCsr->getOsContext().isInitialized());
|
||||
|
||||
ze_command_queue_desc_t desc{};
|
||||
desc.ordinal = 0u;
|
||||
desc.index = 0u;
|
||||
desc.priority = ZE_COMMAND_QUEUE_PRIORITY_PRIORITY_LOW;
|
||||
ze_command_queue_handle_t commandQueueHandle = {};
|
||||
ze_result_t res = device->createCommandQueue(&desc, &commandQueueHandle);
|
||||
EXPECT_EQ(ZE_RESULT_SUCCESS, res);
|
||||
EXPECT_TRUE(lowPriorityCsr->getOsContext().isInitialized());
|
||||
|
||||
auto commandQueue = static_cast<CommandQueueImp *>(L0::CommandQueue::fromHandle(commandQueueHandle));
|
||||
commandQueue->destroy();
|
||||
}
|
||||
|
||||
TEST_F(DeviceCreateCommandQueueTest, givenNormalPriorityDescWhenCreateCommandQueueIsCalledWithValidArgumentThenCsrIsAssignedWithOrdinalAndIndex) {
|
||||
ze_command_queue_desc_t desc{};
|
||||
desc.ordinal = 0u;
|
||||
|
||||
Reference in New Issue
Block a user