You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support UR program creation from multiple device binaries (#2147)
To support multi-device AOT scenario in SYCL we need an ability to create UR
program from multiple device binaries.
Changes in this PR:
* Modify the core function `urProgramCreateWithBinary` to support program
creation from multiple device binaries.
* Add methods to ur_program to get/set per-device data like L0 module handle,
build log etc. Otherwise any change in the structure of the class requires
multiple changes in all UR functions which work with ur_program, in addition
to this it allows to handle interop case (which implementation is an
exception right now) in a single place. Also make State and some other info
per-device because it is possible that UR program is associated with multiple
devices and urProgramBuildExp is called multiple times for subsets, and we
have to know the state per-device.
desc: "Create a program object from device native binary."
122
+
desc: "Create a program object from native binaries for the specified devices."
123
123
class: $xProgram
124
124
name: CreateWithBinary
125
125
decl: static
@@ -128,22 +128,25 @@ analogue:
128
128
- "**clCreateProgramWithBinary**"
129
129
details:
130
130
- "The application may call this function from simultaneous threads."
131
-
- "Following a successful call to this entry point, `phProgram` will contain a binary of type $X_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or $X_PROGRAM_BINARY_TYPE_LIBRARY for `hDevice`."
132
-
- "The device specified by `hDevice` must be device associated with context."
133
-
- "The adapter may (but is not required to) perform validation of the provided module during this call."
131
+
- "Following a successful call to this entry point, `phProgram` will contain binaries of type $X_PROGRAM_BINARY_TYPE_COMPILED_OBJECT or $X_PROGRAM_BINARY_TYPE_LIBRARY for the specified devices in `phDevices`."
132
+
- "The devices specified by `phDevices` must be associated with the context."
133
+
- "The adapter may (but is not required to) perform validation of the provided modules during this call."
134
134
params:
135
135
- type: $x_context_handle_t
136
136
name: hContext
137
137
desc: "[in] handle of the context instance"
138
-
- type: $x_device_handle_t
139
-
name: hDevice
140
-
desc: "[in] handle to device associated with binary."
141
-
- type: size_t
142
-
name: size
143
-
desc: "[in] size in bytes."
144
-
- type: const uint8_t*
145
-
name: pBinary
146
-
desc: "[in] pointer to binary."
138
+
- type: uint32_t
139
+
name: numDevices
140
+
desc: "[in] number of devices"
141
+
- type: $x_device_handle_t*
142
+
name: phDevices
143
+
desc: "[in][range(0, numDevices)] a pointer to a list of device handles. The binaries are loaded for devices specified in this list."
144
+
- type: size_t*
145
+
name: pLengths
146
+
desc: "[in][range(0, numDevices)] array of sizes of program binaries specified by `pBinaries` (in bytes)."
147
+
- type: const uint8_t**
148
+
name: ppBinaries
149
+
desc: "[in][range(0, numDevices)] pointer to program binaries to be loaded for devices specified by `phDevices`."
147
150
- type: const $x_program_properties_t*
148
151
name: pProperties
149
152
desc: "[in][optional] pointer to program creation properties."
0 commit comments