Commit fe60cba
[UR] Implement IPC physical_mem API
Implement urIPCGetPhysMemHandleExp, urIPCPutPhysMemHandleExp,
urIPCOpenPhysMemHandleExp, and urIPCClosePhysMemHandleExp.
Level Zero v2 adapter (Linux, BMG/Xe2+ only):
- physical_mem.hpp and physical_mem.cpp moved to v2/ subdirectory
- urIPCGetPhysMemHandleExp: calls zeMemGetIpcHandleWithProperties
passing ze_physical_mem_handle_t cast to (const void *) directly,
using ze_ipc_mem_handle_type_ext_desc_t with
ZE_IPC_MEM_HANDLE_TYPE_FLAG_DEFAULT; detects fd-based handles via
fcntl(F_GETFD) and returns UR_RESULT_ERROR_UNSUPPORTED_FEATURE
- urIPCOpenPhysMemHandleExp: calls zeMemOpenIpcHandle with flags=0
- urIPCPutPhysMemHandleExp: calls zeMemPutIpcHandle
- urIPCClosePhysMemHandleExp: delegates to urPhysicalMemRelease
- virtual_mem.cpp: urVirtualMemMap returns UR_RESULT_ERROR_INVALID_ARGUMENT
for IPC-opened handles; the virtual address is already established by
zeMemOpenIpcHandle and is accessed via
urPhysicalMemGetInfo(UR_PHYSICAL_MEM_INFO_IPC_VIRTUAL_ADDRESS)
- device.cpp: report UR_DEVICE_INFO_IPC_PHYSICAL_MEMORY_SUPPORT_EXP
as isIntelBMGOrNewer() on Linux, false on Windows
- Add isIntelBMGOrNewer() helper (IP version threshold 0x05004000,
first Xe2 stepping BMG_G21_A0); IPC entry points return
UR_RESULT_ERROR_UNSUPPORTED_FEATURE on pre-Xe2 devices
Level Zero v1 adapter:
- physical_mem.cpp provides only the four non-IPC functions
(urPhysicalMemCreate/Retain/Release/GetInfo)
- Add stub definitions for the four IPC functions returning
UR_RESULT_ERROR_UNSUPPORTED_FEATURE so the L0v1 adapter links correctly
Other adapters (CUDA, HIP, OpenCL, Native CPU, Offload):
- Return UR_RESULT_ERROR_UNSUPPORTED_FEATURE from all four functions
- Report UR_DEVICE_INFO_IPC_PHYSICAL_MEMORY_SUPPORT_EXP as false
Conformance tests:
- Add urIPCGetPhysMemHandleExp.cpp, urIPCPutPhysMemHandleExp.cpp,
urIPCOpenPhysMemHandleExp.cpp, urIPCClosePhysMemHandleExp.cpp
- Add urIPCPhysMemHandleExpFixtures.hpp with urIPCPhysMemTest,
urIPCPhysMemHandleTest, urIPCOpenedPhysMemTest fixtures
Signed-off-by: Lukasz Dorau <lukasz.dorau@intel.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 33b8d68 commit fe60cba
42 files changed
Lines changed: 930 additions & 84 deletions
File tree
- unified-runtime
- include/unified-runtime
- scripts/core
- source
- adapters
- cuda
- hip
- level_zero
- v2
- mock
- native_cpu
- offload
- opencl
- loader
- layers
- tracing
- validation
- test/conformance/virtual_memory
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11306 | 11306 | | |
11307 | 11307 | | |
11308 | 11308 | | |
11309 | | - | |
11310 | | - | |
| 11309 | + | |
| 11310 | + | |
| 11311 | + | |
11311 | 11312 | | |
11312 | 11313 | | |
11313 | 11314 | | |
| |||
11336 | 11337 | | |
11337 | 11338 | | |
11338 | 11339 | | |
11339 | | - | |
11340 | | - | |
| 11340 | + | |
| 11341 | + | |
| 11342 | + | |
11341 | 11343 | | |
11342 | 11344 | | |
11343 | 11345 | | |
| |||
16642 | 16644 | | |
16643 | 16645 | | |
16644 | 16646 | | |
16645 | | - | |
| 16647 | + | |
16646 | 16648 | | |
16647 | 16649 | | |
16648 | 16650 | | |
| |||
16652 | 16654 | | |
16653 | 16655 | | |
16654 | 16656 | | |
16655 | | - | |
| 16657 | + | |
16656 | 16658 | | |
16657 | 16659 | | |
16658 | 16660 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1958 | 1958 | | |
1959 | 1959 | | |
1960 | 1960 | | |
1961 | | - | |
| 1961 | + | |
1962 | 1962 | | |
1963 | 1963 | | |
1964 | 1964 | | |
1965 | 1965 | | |
1966 | | - | |
| 1966 | + | |
1967 | 1967 | | |
1968 | 1968 | | |
1969 | 1969 | | |
| |||
Lines changed: 4 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
177 | 177 | | |
178 | 178 | | |
179 | 179 | | |
180 | | - | |
| 180 | + | |
181 | 181 | | |
182 | | - | |
| 182 | + | |
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| |||
201 | 201 | | |
202 | 202 | | |
203 | 203 | | |
204 | | - | |
| 204 | + | |
205 | 205 | | |
206 | | - | |
| 206 | + | |
207 | 207 | | |
208 | 208 | | |
209 | 209 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1173 | 1173 | | |
1174 | 1174 | | |
1175 | 1175 | | |
| 1176 | + | |
| 1177 | + | |
1176 | 1178 | | |
1177 | 1179 | | |
1178 | 1180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
639 | 639 | | |
640 | 640 | | |
641 | 641 | | |
| 642 | + | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
510 | 510 | | |
511 | 511 | | |
512 | 512 | | |
| 513 | + | |
| 514 | + | |
| 515 | + | |
| 516 | + | |
513 | 517 | | |
514 | 518 | | |
515 | 519 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1021 | 1021 | | |
1022 | 1022 | | |
1023 | 1023 | | |
| 1024 | + | |
| 1025 | + | |
1024 | 1026 | | |
1025 | 1027 | | |
1026 | 1028 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
658 | 658 | | |
659 | 659 | | |
660 | 660 | | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
Lines changed: 4 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
506 | 510 | | |
507 | 511 | | |
508 | 512 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
| |||
132 | 131 | | |
133 | 132 | | |
134 | 133 | | |
135 | | - | |
136 | 134 | | |
137 | 135 | | |
138 | 136 | | |
| |||
145 | 143 | | |
146 | 144 | | |
147 | 145 | | |
148 | | - | |
149 | 146 | | |
150 | 147 | | |
151 | 148 | | |
| |||
170 | 167 | | |
171 | 168 | | |
172 | 169 | | |
| 170 | + | |
173 | 171 | | |
174 | 172 | | |
175 | 173 | | |
| |||
187 | 185 | | |
188 | 186 | | |
189 | 187 | | |
| 188 | + | |
190 | 189 | | |
191 | 190 | | |
192 | 191 | | |
| |||
0 commit comments