mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-03 14:55:24 +08:00
Save topology - slice mapping
Related-To: NEO-5640 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
84f721d35a
commit
cc914ffde3
@@ -521,11 +521,11 @@ uint32_t Drm::getVirtualMemoryAddressSpace(uint32_t vmId) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
bool Drm::translateTopologyInfo(const drm_i915_query_topology_info *queryTopologyInfo, int &sliceCount, int &subSliceCount, int &euCount, int &maxSliceCount) {
|
||||
sliceCount = 0;
|
||||
subSliceCount = 0;
|
||||
euCount = 0;
|
||||
maxSliceCount = queryTopologyInfo->max_slices;
|
||||
bool Drm::translateTopologyInfo(const drm_i915_query_topology_info *queryTopologyInfo, QueryTopologyData &data, TopologyMapping &mapping) {
|
||||
int sliceCount = 0;
|
||||
int subSliceCount = 0;
|
||||
int euCount = 0;
|
||||
int maxSliceCount = queryTopologyInfo->max_slices;
|
||||
std::vector<int> sliceIndices;
|
||||
sliceIndices.reserve(maxSliceCount);
|
||||
|
||||
@@ -556,8 +556,15 @@ bool Drm::translateTopologyInfo(const drm_i915_query_topology_info *queryTopolog
|
||||
|
||||
if (sliceIndices.size()) {
|
||||
maxSliceCount = sliceIndices[sliceIndices.size() - 1] + 1;
|
||||
mapping.sliceIndices = std::move(sliceIndices);
|
||||
}
|
||||
return (sliceCount && subSliceCount && euCount);
|
||||
|
||||
data.sliceCount = sliceCount;
|
||||
data.subSliceCount = subSliceCount;
|
||||
data.euCount = euCount;
|
||||
data.maxSliceCount = maxSliceCount;
|
||||
|
||||
return (data.sliceCount && data.subSliceCount && data.euCount);
|
||||
}
|
||||
|
||||
Drm::~Drm() {
|
||||
@@ -582,4 +589,8 @@ ADAPTER_BDF Drm::getAdapterBDF() const {
|
||||
return adapterBDF;
|
||||
}
|
||||
|
||||
const std::vector<int> &Drm::getSliceMappings(uint32_t deviceIndex) {
|
||||
return topologyMap[deviceIndex].sliceIndices;
|
||||
}
|
||||
|
||||
} // namespace NEO
|
||||
|
||||
@@ -190,9 +190,14 @@ class Drm {
|
||||
void setNewResourceBound(bool value) { this->newResourceBound = value; };
|
||||
bool getNewResourceBound() { return this->newResourceBound; };
|
||||
|
||||
const std::vector<int> &getSliceMappings(uint32_t deviceIndex);
|
||||
|
||||
protected:
|
||||
struct TopologyMapping {
|
||||
std::vector<int> sliceIndices;
|
||||
};
|
||||
int getQueueSliceCount(drm_i915_gem_context_param_sseu *sseu);
|
||||
bool translateTopologyInfo(const drm_i915_query_topology_info *queryTopologyInfo, int &sliceCount, int &subSliceCount, int &euCount, int &maxSliceCount);
|
||||
bool translateTopologyInfo(const drm_i915_query_topology_info *queryTopologyInfo, QueryTopologyData &data, TopologyMapping &mapping);
|
||||
std::string generateUUID();
|
||||
std::string generateElfUUID(const void *data);
|
||||
bool sliceCountChangeSupported = false;
|
||||
@@ -222,6 +227,8 @@ class Drm {
|
||||
std::array<uint64_t, EngineLimits::maxHandleCount> pagingFence;
|
||||
std::array<uint64_t, EngineLimits::maxHandleCount> fenceVal;
|
||||
|
||||
std::unordered_map<uint32_t, TopologyMapping> topologyMap;
|
||||
|
||||
std::string getSysFsPciPath();
|
||||
std::unique_ptr<uint8_t[]> query(uint32_t queryId, uint32_t queryItemFlags, int32_t &length);
|
||||
|
||||
|
||||
@@ -23,7 +23,11 @@ bool Drm::queryTopology(const HardwareInfo &hwInfo, QueryTopologyData &topologyD
|
||||
topologyData.maxSliceCount = data->max_slices;
|
||||
topologyData.maxSubSliceCount = data->max_subslices;
|
||||
topologyData.maxEuCount = data->max_eus_per_subslice;
|
||||
return translateTopologyInfo(data, topologyData.sliceCount, topologyData.subSliceCount, topologyData.euCount, topologyData.maxSliceCount);
|
||||
|
||||
TopologyMapping mapping;
|
||||
auto result = translateTopologyInfo(data, topologyData, mapping);
|
||||
this->topologyMap[0] = mapping;
|
||||
return result;
|
||||
}
|
||||
|
||||
bool Drm::isDebugAttachAvailable() {
|
||||
|
||||
Reference in New Issue
Block a user