mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +08:00
Update Fabric Vertex Support to include iaf querying
This patch adds 1. enumeration of connected iaf devices 2. move fabric vertex to driver, to support deviceless vertices case Related-To: LOCI-3376 Signed-off-by: Joshua Santosh Ranjan <joshua.santosh.ranjan@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
6532cb28bb
commit
44a1f4822b
@@ -159,6 +159,12 @@ DriverHandleImp::~DriverHandleImp() {
|
||||
for (auto &device : this->devices) {
|
||||
delete device;
|
||||
}
|
||||
|
||||
for (auto &fabricVertex : this->fabricVertices) {
|
||||
delete fabricVertex;
|
||||
}
|
||||
this->fabricVertices.clear();
|
||||
|
||||
if (this->svmAllocsManager) {
|
||||
delete this->svmAllocsManager;
|
||||
this->svmAllocsManager = nullptr;
|
||||
@@ -232,6 +238,14 @@ ze_result_t DriverHandleImp::initialize(std::vector<std::unique_ptr<NEO::Device>
|
||||
createHostPointerManager();
|
||||
}
|
||||
|
||||
for (auto &device : this->devices) {
|
||||
|
||||
auto deviceImpl = static_cast<DeviceImp *>(device);
|
||||
auto fabricVertex = FabricVertex::createFromDevice(device);
|
||||
deviceImpl->setFabricVertex(fabricVertex);
|
||||
this->fabricVertices.push_back(fabricVertex);
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
@@ -621,23 +635,16 @@ ze_result_t DriverHandleImp::checkMemoryAccessFromDevice(Device *device, const v
|
||||
|
||||
ze_result_t DriverHandleImp::fabricVertexGetExp(uint32_t *pCount, ze_fabric_vertex_handle_t *phVertices) {
|
||||
|
||||
uint32_t deviceCount = 0;
|
||||
getDevice(&deviceCount, nullptr);
|
||||
|
||||
uint32_t fabricVertexCount = static_cast<uint32_t>(this->fabricVertices.size());
|
||||
if (*pCount == 0) {
|
||||
*pCount = deviceCount;
|
||||
*pCount = fabricVertexCount;
|
||||
return ZE_RESULT_SUCCESS;
|
||||
}
|
||||
|
||||
std::vector<ze_device_handle_t> deviceHandles;
|
||||
deviceHandles.resize(deviceCount);
|
||||
getDevice(&deviceCount, deviceHandles.data());
|
||||
|
||||
*pCount = std::min(deviceCount, *pCount);
|
||||
*pCount = std::min(fabricVertexCount, *pCount);
|
||||
|
||||
for (uint32_t index = 0; index < *pCount; index++) {
|
||||
auto deviceImp = static_cast<DeviceImp *>(deviceHandles[index]);
|
||||
phVertices[index] = deviceImp->fabricVertex->toHandle();
|
||||
phVertices[index] = this->fabricVertices[index]->toHandle();
|
||||
}
|
||||
|
||||
return ZE_RESULT_SUCCESS;
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
|
||||
namespace L0 {
|
||||
class HostPointerManager;
|
||||
struct FabricVertex;
|
||||
|
||||
struct DriverHandleImp : public DriverHandle {
|
||||
~DriverHandleImp() override;
|
||||
@@ -86,6 +87,7 @@ struct DriverHandleImp : public DriverHandle {
|
||||
std::map<void *, NEO::GraphicsAllocation *> sharedMakeResidentAllocations;
|
||||
|
||||
std::vector<Device *> devices;
|
||||
std::vector<FabricVertex *> fabricVertices;
|
||||
// Spec extensions
|
||||
const std::vector<std::pair<std::string, uint32_t>> extensionsSupported = {
|
||||
{ZE_FLOAT_ATOMICS_EXT_NAME, ZE_FLOAT_ATOMICS_EXT_VERSION_CURRENT},
|
||||
|
||||
Reference in New Issue
Block a user