Commit cf18fe1
[SYCL][Bindless][UR][L0][E2E] Fix linear interop memory and L0 V1 adapter leaks. (#18353)
This patch fixes the mapping of interop memory to a linear range
represented by a `void*`. The SYCL Bindless Images spec is clarified
with wording to indicate which free APIs should be used on mapped
imported memory.
Using `sycl::free` for freeing mapped imported linear memory regions
does not work for the LevelZero adapter, as the backend needs to call
`zeMemFree` directly - it cannot go through the regular `sycl::free`
code as that will use UMF free functions by default. This is invalid for
memory regions mapped using `map_external_linear_memory`.
The `unmap_external_linear_memory` SYCL API has been added to the
Bindless Images specification to remedy this problem. An
`unmap_external_image_memory` has also been added.
This patch also introduces an E2E test which verifies that a Vulkan
buffer's memory can be correctly imported into SYCL and its data
retrieved from and written to within a SYCL kernel by using purely USM
pointers (i.e. without using bindless images). This is a step towards
extending the test coverage of interop functionality currently in the
Bindless Images extension, with the goal being at some point splitting
the interop functionality into one or more separate extensions.
Two other fixes have been made in the LevelZero UR adapter.
A leaked `ze_image_handle_t` object has been fixed in the LevelZero V1
adapter. The previous implementation incorrectly reinterpreted bindless
memory handles as `ur_mem_handle_t` types. The implementation of
`urBindlessImagesImageFreeExp` is now unified between V1 and V2,
removing the leak. As such the `level_zero/v2/image.cpp` file has been
removed.
The `urMemoryHandle` member of `ur_ze_external_memory_data` has been
removed. Aside from being incorrectly reinterpreted from
`ur_bindless_mem_handle_t`, the LevelZero adapter does not need to track
the memory handle for external memory resources.1 parent 46a7b91 commit cf18fe1
File tree
41 files changed
+933
-23
lines changed- sycl
- doc/extensions/experimental
- include/sycl/ext/oneapi
- source/detail
- test-e2e/bindless_images/vulkan_interop
- test/abi
- unified-runtime
- include
- scripts/core
- source
- adapters
- cuda
- hip
- level_zero
- v2
- mock
- native_cpu
- opencl
- loader
- layers
- tracing
- validation
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
41 files changed
+933
-23
lines changedLines changed: 38 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2078 | 2078 | | |
2079 | 2079 | | |
2080 | 2080 | | |
| 2081 | + | |
| 2082 | + | |
| 2083 | + | |
| 2084 | + | |
2081 | 2085 | | |
2082 | 2086 | | |
2083 | 2087 | | |
| |||
2093 | 2097 | | |
2094 | 2098 | | |
2095 | 2099 | | |
2096 | | - | |
2097 | | - | |
| 2100 | + | |
| 2101 | + | |
| 2102 | + | |
| 2103 | + | |
| 2104 | + | |
| 2105 | + | |
| 2106 | + | |
| 2107 | + | |
| 2108 | + | |
2098 | 2109 | | |
2099 | | - | |
2100 | | - | |
| 2110 | + | |
| 2111 | + | |
| 2112 | + | |
| 2113 | + | |
| 2114 | + | |
| 2115 | + | |
| 2116 | + | |
| 2117 | + | |
| 2118 | + | |
| 2119 | + | |
| 2120 | + | |
| 2121 | + | |
| 2122 | + | |
| 2123 | + | |
| 2124 | + | |
| 2125 | + | |
| 2126 | + | |
| 2127 | + | |
| 2128 | + | |
| 2129 | + | |
| 2130 | + | |
| 2131 | + | |
| 2132 | + | |
| 2133 | + | |
| 2134 | + | |
2101 | 2135 | | |
2102 | 2136 | | |
2103 | 2137 | | |
| |||
2110 | 2144 | | |
2111 | 2145 | | |
2112 | 2146 | | |
2113 | | - | |
2114 | | - | |
2115 | | - | |
2116 | 2147 | | |
2117 | 2148 | | |
2118 | 2149 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
285 | 285 | | |
286 | 286 | | |
287 | 287 | | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
| 315 | + | |
| 316 | + | |
| 317 | + | |
| 318 | + | |
| 319 | + | |
| 320 | + | |
| 321 | + | |
| 322 | + | |
| 323 | + | |
| 324 | + | |
| 325 | + | |
| 326 | + | |
| 327 | + | |
| 328 | + | |
| 329 | + | |
| 330 | + | |
| 331 | + | |
| 332 | + | |
| 333 | + | |
| 334 | + | |
| 335 | + | |
288 | 336 | | |
289 | 337 | | |
290 | 338 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
621 | 621 | | |
622 | 622 | | |
623 | 623 | | |
| 624 | + | |
| 625 | + | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
| 637 | + | |
| 638 | + | |
| 639 | + | |
| 640 | + | |
| 641 | + | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
624 | 648 | | |
625 | 649 | | |
626 | 650 | | |
| |||
0 commit comments