Skip to content

Commit 6137dea

Browse files
committed
[SYCL] Update SYCLPluginInterface.md with further design details.
Signed-off-by: Garima Gupta <garima.gupta@intel.com>
1 parent bffdbcd commit 6137dea

File tree

1 file changed

+48
-8
lines changed

1 file changed

+48
-8
lines changed

sycl/doc/SYCLPluginInterface.md

+48-8
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
# The SYCL Runtime Plugin Interface.
2-
1+
#The SYCL Runtime Plugin Interface.
32

43
## Overview
54
The SYCL Runtime Plugin Interface (PI) is the interface layer between
@@ -41,12 +40,45 @@ once before any actual offload is attempted.
4140

4241
### Plugin discovery
4342

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.
4665

4766
#### 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.
5082

5183
#### OpenCL plugin
5284

@@ -60,8 +92,16 @@ TBD describe the nested OpenCL implementation discovery process performed by
6092
the OpenCL plugin
6193

6294
### 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.
63103

64-
TBD
104+
TBD Unloading a connected plugin.
65105

66106
## PI API Specification
67107

@@ -133,4 +173,4 @@ pi_program piclProgramCreateWithSource(
133173
TBD This section describes a mechanism for SYCL or other runtimes to detect
134174
availability of and obtain interfaces beyond those defined by the PI dispatch.
135175

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

Comments
 (0)