1
- # The SYCL Runtime Plugin Interface.
2
-
1
+ #The SYCL Runtime Plugin Interface.
3
2
4
3
## Overview
5
4
The SYCL Runtime Plugin Interface (PI) is the interface layer between
@@ -41,12 +40,45 @@ once before any actual offload is attempted.
41
40
42
41
### Plugin discovery
43
42
44
- Plugins are physically dynamic libraries stored somewhere in the system where
45
- the SYCL runtime runs. TBD - design and describe the process in details.
43
+ Plugins are physically dynamic libraries or shared objects.
44
+ The process to discover plugins will follow the following guidelines.
45
+
46
+ The SYCL Runtime will search for plugins at env LD_LIBRARY_PATH location on
47
+ Linux and env LIB on Windows, with names in the format of libpiXXX.so and
48
+ query them. An extension to the search mechanism is to use a configuration file
49
+ which lists all the available plugins and their locations.
50
+ This file can be stored along with SYCL Runtime.
51
+ Plugins should expose the information of supported PI API version as a constant
52
+ string, so it can be read without loading the library.
53
+ The user can select/disable a specifc plugin with an environment variable.
54
+ The Plugin Interface queries the plugins on the supported PI version and check
55
+ for compatibility.
56
+ The Plugin Interface then queries each plugin for all Interface Functions
57
+ corresponding function pointers and populate a list of these pointers for
58
+ each plugin. As an extension, the plugin can provide a populated function
59
+ pointer table/struct for each device attached to the plugin.
60
+ A trace mechanism should be provided to log the discovery/connection/device
61
+ enumeration process. Eg: Display all the plugins being discovered, their
62
+ information and supported PI version. List attached devices and their properties.
63
+
64
+ TBD - design and describe the process in detail.
46
65
47
66
#### Plugin binary interface
48
- TBD - list and describe all the symbols plugin must export in order to be picked
49
- up by the SYCL runtime for offload.
67
+ Currently the plugins should export all the symbols that are present in the file
68
+ pi.h. In the future, this document will list the minimum set of Interface APIs
69
+ to be supported by Plugins. This will also require adding functionality to SYCL
70
+ Runtime to work with such limited functionality plugins.
71
+
72
+ TBD - list and describe all the symbols that a plugin must export in order to
73
+ be picked up by the SYCL runtime for offload.
74
+
75
+ #### Connection to a Plugin
76
+ Plugin selection can be forced via environment variable: SYCL_PI_USE.
77
+ Default is OpenCL Plugin. The connection is established when PI is forwarding
78
+ the PI API calls needed to run the program to the selected plugin.
79
+ There is pi.def file that lists all PI API to query/connect each API entries.
80
+ The Plugin interface will have to check that the supported PI API version info
81
+ is in sync with the actual API entries being available in plugins.
50
82
51
83
#### OpenCL plugin
52
84
@@ -60,8 +92,16 @@ TBD describe the nested OpenCL implementation discovery process performed by
60
92
the OpenCL plugin
61
93
62
94
### Device enumeration by plugins
95
+ After the compatible plugins are loaded, the trace will show all available
96
+ devices from each plugin. Similarly, the trace can be extended to show the
97
+ underlying API calls that each PI plugin call is being directed to.
98
+
99
+ TBD Describe the exact API calls to enable device enumeration feature.
100
+
101
+ ### Plugin Unloading
102
+ The plugins not chosen to be connected to will be unloaded.
63
103
64
- TBD
104
+ TBD Unloading a connected plugin.
65
105
66
106
## PI API Specification
67
107
@@ -133,4 +173,4 @@ pi_program piclProgramCreateWithSource(
133
173
TBD This section describes a mechanism for SYCL or other runtimes to detect
134
174
availability of and obtain interfaces beyond those defined by the PI dispatch.
135
175
136
- TBD Add API to query PI version supported by plugin at runtime.
176
+ TBD Add API to query PI version supported by plugin at runtime.
0 commit comments