![]() |
ATLAS Offline Software
|
Service used for programming XRT compatible accelerators. More...
#include <DeviceMgmtSvc.h>
Classes | |
| struct | AthClContext |
| Struct to hold information about a context, as well as the devices, the program and XCLBIN file associated with the context. More... | |
| struct | SystemInfo |
| struct | XclbinInfo |
| Struct to hold information about an XCLBIN file, as well as the kernels it contains. More... | |
Public Member Functions | |
Interface inherited from @c IService | |
| virtual StatusCode | initialize () override |
| Initialise the service. | |
| virtual StatusCode | finalize () override |
| Finalise the service. | |
Interface inherited from @c AthXRT::IDeviceMgmtSvc | |
| virtual const std::vector< IDeviceMgmtSvc::OpenCLHandle > | get_opencl_handles_by_kernel_name (const std::string &name) const override |
| Get a list of OpenCL handles providing the specified kernel. | |
| virtual const std::vector< std::shared_ptr< xrt::device > > | get_xrt_devices_by_kernel_name (const std::string &name) const override |
| Get a list of XRT devices providing the specified kernel. | |
Private Member Functions | |
| std::string | get_device_name (const cl::Device &device) const |
| Get the name of a cl::device. | |
| std::string | get_device_bdf (const cl::Device &device) const |
| Get the BDF (bus:device:function) string of a cl::device. | |
| StatusCode | inspect_devices (SystemInfo &si) |
| Inspect the available devices and fill the SystemInfo structure. | |
| StatusCode | inspect_xclbins (SystemInfo &si) |
| Inspect the provided XCLBIN files and fill the SystemInfo structure. | |
| StatusCode | pair_devices_and_xclbins (const SystemInfo &si) |
| Pair devices and XCLBINs and create contexts. | |
| StatusCode | program_devices () |
| Program the devices with the XCLBIN files and create contexts. | |
| bool | is_xclbin_compatible_with_device (const DeviceMgmtSvc::XclbinInfo &xclbin_info, const cl::Device &device) const |
| Helper function to check if an XCLBIN file is compatible with a device. | |
Private Attributes | |
| std::vector< XclbinInfo > | m_xclbin_infos |
| List of XCLBIN files info configured for the service. | |
| std::vector< AthClContext > | m_ath_cl_contexts |
| List of contexts configured for the service. | |
Service properties | |
| Gaudi::Property< std::vector< std::string > > | m_xclbin_path_list |
| The list of xclbin files to use. | |
Service used for programming XRT compatible accelerators.
This service aims to be a central point for managing XRT compatible accelerators. It will enumerate the available devices, program them with the specified XCLBIN files and provide a way for client algorithms to request lists of devices by kernel name, either using native XRT API or OpenCL API.
Definition at line 31 of file DeviceMgmtSvc.h.
|
overridevirtual |
Finalise the service.
Definition at line 485 of file DeviceMgmtSvc.cxx.
|
private |
Get the BDF (bus:device:function) string of a cl::device.
| device | The device to get the BDF from. |
Definition at line 194 of file DeviceMgmtSvc.cxx.
|
private |
Get the name of a cl::device.
| device | The device to get the name from. |
Definition at line 179 of file DeviceMgmtSvc.cxx.
|
overridevirtual |
Get a list of OpenCL handles providing the specified kernel.
| name | The name of the kernel to search for. |
Definition at line 524 of file DeviceMgmtSvc.cxx.
|
overridevirtual |
Get a list of XRT devices providing the specified kernel.
| name | The name of the kernel to search for. |
Definition at line 495 of file DeviceMgmtSvc.cxx.
|
overridevirtual |
Initialise the service.
Initialize the service.
This function will inspect the available devices and XCLBIN files, pair them and create contexts based on the information gathered. It will then program the devices with the XCLBIN files and create contexts.
Definition at line 461 of file DeviceMgmtSvc.cxx.
|
private |
Inspect the available devices and fill the SystemInfo structure.
Find all available XRT compatible accelerator devices and group them by type.
| si | The SystemInfo structure to fill |
Definition at line 19 of file DeviceMgmtSvc.cxx.
|
private |
Inspect the provided XCLBIN files and fill the SystemInfo structure.
Gather information using XRT native API about the XCLBIN files and the kernel(s) they contain and perform some basic sanity checks.
| si | The SystemInfo structure to fill |
Definition at line 91 of file DeviceMgmtSvc.cxx.
|
private |
Helper function to check if an XCLBIN file is compatible with a device.
Check if an XCLBIN is compatible with a device.
This is done by comparing the device name and the XSA name used in the XCLBIN file up to the second occurrence of the underscore character. This check is not a guarantee that the XCLBIN will work on the device, but mismatching XSA names are a strong indicator of incompatibility.
| xclbin_info | The XCLBIN to check compatibility with. |
| device | The device to check compatibility with. |
Definition at line 241 of file DeviceMgmtSvc.cxx.
|
private |
Pair devices and XCLBINs and create contexts.
This function will pair devices and XCLBINsd epending on the number of devices and XCLBINs, will attempt to program all provided XCLBINs according to the following rules:
| si | The SystemInfo structure containing information about the devices and XCLBINs available on the system. |
Definition at line 276 of file DeviceMgmtSvc.cxx.
|
private |
Program the devices with the XCLBIN files and create contexts.
This function will program the devices with the XCLBIN files and create contexts based on the information in m_ath_cl_contexts. If an incompatible XCLBIN is found for a device, the initialization will fail.
Definition at line 396 of file DeviceMgmtSvc.cxx.
|
private |
List of contexts configured for the service.
Definition at line 138 of file DeviceMgmtSvc.h.
|
private |
List of XCLBIN files info configured for the service.
Definition at line 126 of file DeviceMgmtSvc.h.
|
private |
The list of xclbin files to use.
This is a list of paths to XCLBIN files to load on accelerator devices.
Definition at line 72 of file DeviceMgmtSvc.h.