mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-04 23:56:39 +08:00
feature: switch to new aubstream createHardwareContext2 interface
Related-To: NEO-12257 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
a47ca96a42
commit
3f6fc1d4d2
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (C) 2019-2022 Intel Corporation
|
||||
* Copyright (C) 2019-2024 Intel Corporation
|
||||
*
|
||||
* SPDX-License-Identifier: MIT
|
||||
*
|
||||
@@ -12,13 +12,18 @@
|
||||
#include "shared/source/os_interface/os_context.h"
|
||||
|
||||
#include "aubstream/allocation_params.h"
|
||||
#include "aubstream/aubstream.h"
|
||||
using namespace NEO;
|
||||
|
||||
HardwareContextController::HardwareContextController(aub_stream::AubManager &aubManager, OsContext &osContext, uint32_t flags) {
|
||||
auto deviceBitfield = osContext.getDeviceBitfield();
|
||||
for (uint32_t deviceIndex = 0; deviceIndex < deviceBitfield.size(); deviceIndex++) {
|
||||
if (deviceBitfield.test(deviceIndex)) {
|
||||
hardwareContexts.emplace_back(aubManager.createHardwareContext(deviceIndex, osContext.getEngineType(), flags));
|
||||
aub_stream::CreateHardwareContext2Params params = {osContext.getContextId(), aub_stream::hardwareContextId::invalidContextId};
|
||||
if (osContext.getPrimaryContext()) {
|
||||
params.primaryContextId = osContext.getPrimaryContext()->getContextId();
|
||||
}
|
||||
hardwareContexts.emplace_back(aubManager.createHardwareContext2(params, deviceIndex, osContext.getEngineType(), flags));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,6 +84,11 @@ class MockAubManager : public aub_stream::AubManager {
|
||||
return new MockHardwareContext(device);
|
||||
}
|
||||
|
||||
HardwareContext *createHardwareContext2(const aub_stream::CreateHardwareContext2Params ¶ms, uint32_t device, uint32_t engine, uint32_t flags) override {
|
||||
contextFlags = flags;
|
||||
return new MockHardwareContext(device);
|
||||
}
|
||||
|
||||
bool releaseHardwareContext(HardwareContext *context) override {
|
||||
delete context;
|
||||
return true;
|
||||
|
||||
Reference in New Issue
Block a user