feature: Affinity mask plus ReturnSubDevicesAsApiDevices

When using ReturnSubDevicesAsApiDevices=1 to have
sub-devices-as-root-devices, then the driver should read the values
passed in the mask as those corresponding to the physical
sub-devices.

For instance, in a dual system with multi-tile device, we would have:

card 0, tile 0
card 0, tile 1
card 1, tile 0
card 1, tile 1

With:
ReturnSubDevicesAsApiDevices=0
ZE_AFFINITY_MASK=0,1

Then all tiles in card 0 and card 1 need to be exposed.

With:
ReturnSubDevicesAsApiDevices=1
ZE_AFFINITY_MASK=0,3

Then card 0 tile 0, and card 1 tile 1 need to be exposed.

Related-To: NEO-7137

Signed-off-by: Jaime Arteaga <jaime.a.arteaga.molina@intel.com>
This commit is contained in:
Jaime Arteaga
2023-02-02 02:54:47 +00:00
committed by Compute-Runtime-Automation
parent 275bed2a31
commit 07598fb5e0
5 changed files with 190 additions and 20 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright (C) 2018-2022 Intel Corporation
* Copyright (C) 2018-2023 Intel Corporation
*
* SPDX-License-Identifier: MIT
*
@@ -12,6 +12,7 @@
#include <algorithm>
#include <cstdint>
#include <limits>
#include <tuple>
#include <vector>
template <size_t OnStackCapacity>
@@ -479,4 +480,6 @@ bool operator!=(const StackVec<T, LhsStackCaps> &lhs,
return false == (lhs == rhs);
}
using RootDeviceIndicesContainer = StackVec<uint32_t, 16>;
constexpr size_t MaxRootDeviceIndices = 16;
using RootDeviceIndicesContainer = StackVec<uint32_t, MaxRootDeviceIndices>;
using RootDeviceIndicesMap = StackVec<std::tuple<uint32_t, uint32_t>, MaxRootDeviceIndices>;