Skip to content

Commit ec5890b

Browse files
committed
[SYCL] Static linking support in Level Zero plugin
The Level Zero driver now has "static linking" support, the ability to create a single Level Zero module from a list of SPIR-V modules. Use this feature to implement `piProgramLink`, replacing the previous implementation that relied on "dynamic linking" of Level Zero modules. There are two main improvements: * Static linking provides more optimizations because the compiler sees the SPIR-V for all modules, which enables cross-module optimizations. * The previous implementation was mostly using mock driver APIs, and it didn't work in the general case when `piProgramLink` tried to link more than one input module together. This is mostly an infrastructure improvement, which does not provide any new features or bug fixes. Since there is no Level Zero interop API that can create a `kernel_bundle` in `object` or `input` state, there is no need currently to link multiple Level Zero modules together with `piProgramLink`. However, this commit provides the infrastructure we need to enable online linking of the "device library" into device code. That feature will be enabled in a future commit.
1 parent 8677d5d commit ec5890b

File tree

3 files changed

+258
-549
lines changed

3 files changed

+258
-549
lines changed

sycl/include/CL/sycl/detail/pi.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ typedef enum {
114114
PI_INVALID_IMAGE_FORMAT_DESCRIPTOR = CL_INVALID_IMAGE_FORMAT_DESCRIPTOR,
115115
PI_IMAGE_FORMAT_NOT_SUPPORTED = CL_IMAGE_FORMAT_NOT_SUPPORTED,
116116
PI_MEM_OBJECT_ALLOCATION_FAILURE = CL_MEM_OBJECT_ALLOCATION_FAILURE,
117+
PI_LINK_PROGRAM_FAILURE = CL_LINK_PROGRAM_FAILURE,
117118
PI_FUNCTION_ADDRESS_IS_NOT_AVAILABLE =
118119
-998, ///< PI_FUNCTION_ADDRESS_IS_NOT_AVAILABLE indicates a fallback
119120
///< method determines the function exists but its address cannot be

0 commit comments

Comments
 (0)