mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 23:56:39 +08:00
Split command list fixture into implementation and interface file
Related-To: NEO-5019 Signed-off-by: Zbigniew Zdanowicz <zbigniew.zdanowicz@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
3f03c57d55
commit
1b7de2591b
@@ -9,6 +9,7 @@ set(TARGET_NAME ${TARGET_NAME_L0}_fixtures)
|
||||
set(L0_FIXTURES_SOURCES
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/aub_csr_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_fixture.cpp
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/cmdlist_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_fixture.h
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/device_fixture.cpp
|
||||
|
||||
39
level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp
Normal file
39
level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.cpp
Normal file
@@ -0,0 +1,39 @@
|
||||
/*
|
||||
* Copyright (C) 2022 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
*/
|
||||
|
||||
#include "level_zero/core/test/unit_tests/fixtures/cmdlist_fixture.h"
|
||||
|
||||
namespace L0 {
|
||||
namespace ult {
|
||||
|
||||
void CommandListFixture::setUp() {
|
||||
DeviceFixture::setUp();
|
||||
ze_result_t returnValue;
|
||||
commandList.reset(whiteboxCast(CommandList::create(device->getHwInfo().platform.eProductFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
|
||||
eventPoolDesc.count = 2;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.wait = 0;
|
||||
eventDesc.signal = 0;
|
||||
|
||||
eventPool = std::unique_ptr<EventPool>(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
|
||||
event = std::unique_ptr<Event>(Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
}
|
||||
|
||||
void CommandListFixture::tearDown() {
|
||||
event.reset(nullptr);
|
||||
eventPool.reset(nullptr);
|
||||
commandList.reset(nullptr);
|
||||
DeviceFixture::tearDown();
|
||||
}
|
||||
|
||||
} // namespace ult
|
||||
} // namespace L0
|
||||
@@ -21,30 +21,8 @@ namespace ult {
|
||||
|
||||
class CommandListFixture : public DeviceFixture {
|
||||
public:
|
||||
void setUp() {
|
||||
DeviceFixture::setUp();
|
||||
ze_result_t returnValue;
|
||||
commandList.reset(whiteboxCast(CommandList::create(productFamily, device, NEO::EngineGroupType::RenderCompute, 0u, returnValue)));
|
||||
|
||||
ze_event_pool_desc_t eventPoolDesc = {};
|
||||
eventPoolDesc.flags = ZE_EVENT_POOL_FLAG_HOST_VISIBLE;
|
||||
eventPoolDesc.count = 2;
|
||||
|
||||
ze_event_desc_t eventDesc = {};
|
||||
eventDesc.index = 0;
|
||||
eventDesc.wait = 0;
|
||||
eventDesc.signal = 0;
|
||||
|
||||
eventPool = std::unique_ptr<EventPool>(EventPool::create(driverHandle.get(), context, 0, nullptr, &eventPoolDesc, returnValue));
|
||||
event = std::unique_ptr<Event>(Event::create<uint32_t>(eventPool.get(), &eventDesc, device));
|
||||
}
|
||||
|
||||
void tearDown() {
|
||||
event.reset(nullptr);
|
||||
eventPool.reset(nullptr);
|
||||
commandList.reset(nullptr);
|
||||
DeviceFixture::tearDown();
|
||||
}
|
||||
void setUp();
|
||||
void tearDown();
|
||||
|
||||
std::unique_ptr<L0::ult::CommandList> commandList;
|
||||
std::unique_ptr<EventPool> eventPool;
|
||||
@@ -64,10 +42,10 @@ struct MultiTileCommandListFixture : public SingleRootMultiSubDeviceFixture {
|
||||
NEO::EngineGroupType cmdListEngineType = createCopy ? NEO::EngineGroupType::Copy : NEO::EngineGroupType::RenderCompute;
|
||||
|
||||
if (!createImmediate) {
|
||||
commandList.reset(whiteboxCast(CommandList::create(productFamily, device, cmdListEngineType, 0u, returnValue)));
|
||||
commandList.reset(whiteboxCast(CommandList::create(device->getHwInfo().platform.eProductFamily, device, cmdListEngineType, 0u, returnValue)));
|
||||
} else {
|
||||
const ze_command_queue_desc_t desc = {};
|
||||
commandList.reset(whiteboxCast(CommandList::createImmediate(productFamily, device, &desc, createInternal, cmdListEngineType, returnValue)));
|
||||
commandList.reset(whiteboxCast(CommandList::createImmediate(device->getHwInfo().platform.eProductFamily, device, &desc, createInternal, cmdListEngineType, returnValue)));
|
||||
}
|
||||
ASSERT_EQ(ZE_RESULT_SUCCESS, returnValue);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user