Skip to content

[SYCL][Bindless][Doc] Rename interop related structs/funcs to external #14444

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 44 commits into from
Jul 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
7125ba0
[SYCL][Bindless][Doc][ABI-Break] Rename interop related structs/funcs…
Seanst98 Jun 4, 2024
98d3910
merge branch 'origin/sycl' into duncan/host-to-device-handle-map
DBDuncan Jul 8, 2024
2756ec6
Update UR commit
DBDuncan Jul 8, 2024
a870d0b
merge branch 'origin/sycl' into duncan/rename-interop-handle
DBDuncan Jul 8, 2024
3bcd837
Update UR commit
DBDuncan Jul 8, 2024
abb3d90
Merge remote-tracking branch 'origin/sycl' into sean/rename-interop-h…
DBDuncan Jul 9, 2024
c7ba9b0
Update UR repo link
DBDuncan Jul 9, 2024
9057dd0
Update pi major and minor versions
DBDuncan Jul 9, 2024
d3e8125
merge branch 'origin/sycl' into duncan/rename-interop-handle
DBDuncan Jul 9, 2024
b62170d
Update UR commit
DBDuncan Jul 9, 2024
a9d2d9f
Fix some minor renaming mistakes
DBDuncan Jul 10, 2024
7009f96
Merge branch 'sycl' into sean/rename-interop-handle
cppchedy Jul 12, 2024
4cc3633
update UR tag
cppchedy Jul 12, 2024
b0fae39
Merge remote-tracking branch 'origin/sycl' into sean/rename-interop-h…
DBDuncan Jul 15, 2024
83f7570
Update UR commit
DBDuncan Jul 15, 2024
365c4bb
Fix windows symbols
DBDuncan Jul 16, 2024
6ffbe74
merge branch 'origin/sycl' into duncan/rename-interop-handle
DBDuncan Jul 16, 2024
1f02f98
Update UR commit
DBDuncan Jul 16, 2024
eeb01b7
merge branch 'origin/sycl' into sean/rename-interop-handle
DBDuncan Jul 17, 2024
c2bf7e3
Update UR commit
DBDuncan Jul 17, 2024
25926f5
Format code
DBDuncan Jul 17, 2024
e1493ac
merge 'origin/sycl' into sean/rename-interop-handle
DBDuncan Jul 18, 2024
efd793b
Update UR commit
DBDuncan Jul 18, 2024
bb1d52c
Update linux dump test symbols
DBDuncan Jul 18, 2024
b5f5a53
Fix 'external_semaphore_handle' not being renamed to 'external_semaph…
DBDuncan Jul 18, 2024
72db0f7
Update sycl windows symbols test
DBDuncan Jul 19, 2024
1e144e6
Merge remote-tracking branch 'origin/sycl' into sean/rename-interop-h…
DBDuncan Jul 19, 2024
e219959
Update UR commit
DBDuncan Jul 19, 2024
ff6e4bf
Merge remote-tracking branch 'origin/sycl' into sean/rename-interop-h…
DBDuncan Jul 22, 2024
d0ea987
Merge 'origin/sycl' into sean/rename-interop-handle
DBDuncan Jul 22, 2024
78f4767
Update UR commit
DBDuncan Jul 22, 2024
996c2de
Update UR commit to fix formatting mistake
DBDuncan Jul 22, 2024
ec0c81a
Merge 'origin/sycl' into sean/rename-interop-handle
DBDuncan Jul 24, 2024
7f7579e
Update UR commit
DBDuncan Jul 24, 2024
54084b4
Update test variable naming to use 'external' instead of 'interop'
DBDuncan Jul 24, 2024
75e1507
Rerun CI
DBDuncan Jul 24, 2024
408cbd1
Merge remote-tracking branch 'origin/sycl' into sean/rename-interop-h…
DBDuncan Jul 24, 2024
6f3ff20
Update UR commit
DBDuncan Jul 24, 2024
acc086e
Update UR commit
DBDuncan Jul 24, 2024
435a7ee
Update UR commit
DBDuncan Jul 24, 2024
9a301db
merge 'origin/sycl' into sean/rename-interop-handle
DBDuncan Jul 29, 2024
d515433
Update UR commit
DBDuncan Jul 29, 2024
c733fa1
merge 'origin/sycl' into sean/rename-interop-handle
DBDuncan Jul 29, 2024
fd54d86
Update UR commit
DBDuncan Jul 29, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions llvm/include/llvm/SYCLLowerIR/DeviceConfigFile.td
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,8 @@ def AspectExt_oneapi_bindless_images : Aspect<"ext_oneapi_bindless_images">;
def AspectExt_oneapi_bindless_images_shared_usm : Aspect<"ext_oneapi_bindless_images_shared_usm">;
def AspectExt_oneapi_bindless_images_1d_usm : Aspect<"ext_oneapi_bindless_images_1d_usm">;
def AspectExt_oneapi_bindless_images_2d_usm : Aspect<"ext_oneapi_bindless_images_2d_usm">;
def AspectExt_oneapi_interop_memory_import : Aspect<"ext_oneapi_interop_memory_import">;
def AspectExt_oneapi_interop_semaphore_import : Aspect<"ext_oneapi_interop_semaphore_import">;
def AspectExt_oneapi_external_memory_import : Aspect<"ext_oneapi_external_memory_import">;
def AspectExt_oneapi_external_semaphore_import : Aspect<"ext_oneapi_external_semaphore_import">;
def AspectExt_oneapi_mipmap : Aspect<"ext_oneapi_mipmap">;
def AspectExt_oneapi_mipmap_anisotropy : Aspect<"ext_oneapi_mipmap_anisotropy">;
def AspectExt_oneapi_mipmap_level_reference : Aspect<"ext_oneapi_mipmap_level_reference">;
Expand Down Expand Up @@ -130,16 +130,17 @@ def : TargetInfo<"__TestAspectList",
AspectExt_intel_device_id, AspectExt_intel_memory_clock_rate, AspectExt_intel_memory_bus_width, AspectEmulated,
AspectExt_intel_legacy_image, AspectExt_oneapi_bindless_images,
AspectExt_oneapi_bindless_images_shared_usm, AspectExt_oneapi_bindless_images_1d_usm, AspectExt_oneapi_bindless_images_2d_usm,
AspectExt_oneapi_interop_memory_import, AspectExt_oneapi_interop_semaphore_import,
AspectExt_oneapi_external_memory_import, AspectExt_oneapi_external_semaphore_import,
AspectExt_oneapi_mipmap, AspectExt_oneapi_mipmap_anisotropy, AspectExt_oneapi_mipmap_level_reference,
AspectExt_oneapi_bindless_sampled_image_fetch_3d, AspectExt_oneapi_cubemap,
AspectExt_oneapi_cubemap,
AspectExt_oneapi_cubemap_seamless_filtering,
AspectExt_oneapi_image_array,
AspectExt_oneapi_unique_addressing_per_dim,
AspectExt_oneapi_bindless_images_sample_1d_usm,
AspectExt_oneapi_bindless_images_sample_2d_usm,
AspectExt_oneapi_bindless_sampled_image_fetch_1d_usm, AspectExt_oneapi_bindless_sampled_image_fetch_1d,
AspectExt_oneapi_bindless_sampled_image_fetch_2d_usm, AspectExt_oneapi_bindless_sampled_image_fetch_2d,
AspectExt_oneapi_bindless_sampled_image_fetch_3d,
AspectExt_intel_esimd,
AspectExt_oneapi_ballot_group, AspectExt_oneapi_fixed_size_group, AspectExt_oneapi_opportunistic_group,
AspectExt_oneapi_tangle_group, AspectExt_intel_matrix, AspectExt_oneapi_is_composite, AspectExt_oneapi_is_component,
Expand Down Expand Up @@ -220,8 +221,8 @@ defvar CudaMinAspects = !listconcat(AllUSMAspects, [AspectGpu, AspectFp64, Aspec
AspectExt_oneapi_opportunistic_group, AspectExt_oneapi_graph, AspectExt_oneapi_limited_graph]);
// Bindless images aspects are partially supported on CUDA and disabled by default at the moment.
defvar CudaBindlessImagesAspects = [AspectExt_oneapi_bindless_images, AspectExt_oneapi_bindless_images_shared_usm,
AspectExt_oneapi_bindless_images_1d_usm, AspectExt_oneapi_bindless_images_2d_usm, AspectExt_oneapi_interop_memory_import,
AspectExt_oneapi_interop_semaphore_import, AspectExt_oneapi_mipmap, AspectExt_oneapi_mipmap_anisotropy,
AspectExt_oneapi_bindless_images_1d_usm, AspectExt_oneapi_bindless_images_2d_usm, AspectExt_oneapi_external_memory_import,
AspectExt_oneapi_external_semaphore_import, AspectExt_oneapi_mipmap, AspectExt_oneapi_mipmap_anisotropy,
AspectExt_oneapi_mipmap_level_reference, AspectExt_oneapi_cubemap, AspectExt_oneapi_cubemap_seamless_filtering,
AspectExt_oneapi_image_array, AspectExt_oneapi_unique_addressing_per_dim, AspectExt_oneapi_bindless_images_sample_2d_usm,
AspectExt_oneapi_bindless_images_sample_2d_usm];
Expand Down
13 changes: 6 additions & 7 deletions sycl/cmake/modules/FetchUnifiedRuntime.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -116,13 +116,12 @@ if(SYCL_PI_UR_USE_FETCH_CONTENT)
endfunction()

set(UNIFIED_RUNTIME_REPO "https://github.com/oneapi-src/unified-runtime.git")
# commit a985a81dc9ba8adfcc8b54e35ad287e97766fb3e
# Merge: b7b0c8b3 f772f907
# Author: Piotr Balcer <[email protected]>
# Date: Mon Jul 29 09:11:29 2024 +0200
# Merge pull request #1905 from igchor/umf_hwloc_disable
# Bump UMF version to allow disabling hwloc
set(UNIFIED_RUNTIME_TAG a985a81dc9ba8adfcc8b54e35ad287e97766fb3e)
# commit bc1a28ede0df7f837047b632e00437587672c134
# Author: Omar Ahmed <[email protected]>
# Date: Mon Jul 29 16:44:58 2024 +0100
# Merge pull request #1819 from DBDuncan/sean/rename-interop-to-external
# [Bindless][Exp] Rename interop related structs/funcs with "external"
set(UNIFIED_RUNTIME_TAG bc1a28ede0df7f837047b632e00437587672c134)

set(UMF_BUILD_EXAMPLES OFF CACHE INTERNAL "EXAMPLES")
# Due to the use of dependentloadflag and no installer for UMF and hwloc we need
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1591,9 +1591,9 @@ The device aspect descriptors for these queries are:
[frame="none",options="header"]
|======================
|Device descriptor |Description
|`aspect::ext_oneapi_interop_memory_import` | Indicates if the device supports
|`aspect::ext_oneapi_external_memory_import` | Indicates if the device supports
importing external memory resources.
|`aspect::ext_oneapi_interop_semaphore_import`` | Indicates if the device
|`aspect::ext_oneapi_external_semaphore_import`` | Indicates if the device
supports importing external semaphore resources.
|======================

Expand Down Expand Up @@ -1687,35 +1687,35 @@ resource type.
```cpp
namespace sycl::ext::oneapi::experimental {

struct interop_mem_handle {
struct external_mem {
using raw_handle_type = /* Implementation defined */;
raw_handle_type raw_handle;
};

template <typename ResourceType>
interop_mem_handle import_external_memory(
external_mem import_external_memory(
external_mem_descriptor<ResourceType> externalMemDescriptor,
const sycl::device &syclDevice,
const sycl::context &syclContext);

template <typename ResourceType>
interop_mem_handle import_external_memory(
external_mem import_external_memory(
external_mem_descriptor<ResourceType> externalMemDescriptor,
const sycl::queue &syclQueue);

image_mem_handle map_external_image_memory(
interop_mem_handle interopMemHandle,
external_mem externalMemHandle,
const image_descriptor &imageDescriptor,
const sycl::device &syclDevice,
const sycl::context &syclContext);
image_mem_handle map_external_image_memory(
interop_mem_handle interopMemHandle,
external_mem externalMemHandle,
const image_descriptor &imageDescriptor,
const sycl::queue &syclQueue);
}
```

The resulting `interop_mem_handle` can then be mapped, where the resulting type
The resulting `external_mem` can then be mapped, where the resulting type
is an `image_mem_handle`. This can be used to construct images in the same way
as memory allocated through `alloc_image_mem`. The `ext_oneapi_copy` operations
also work with imported memory mapped to `image_mem_handle` types.
Expand All @@ -1734,16 +1734,16 @@ behaviour.
Once a user has finished operating on imported memory, they must ensure that
they destroy the imported memory handle through `release_external_memory`.

`release_external_memory` can only accept `interop_mem_handles` that were
`release_external_memory` can only accept `external_mem` objects that were
created through `import_external_memory`.

```cpp
namespace sycl::ext::oneapi::experimental {

void release_external_memory(interop_mem_handle interopMem,
void release_external_memory(external_mem externalMem,
const sycl::device &syclDevice,
const sycl::context &syclContext);
void release_external_memory(interop_mem_handle interopMem,
void release_external_memory(external_mem externalMem,
const sycl::queue &syclQueue);
}
```
Expand Down Expand Up @@ -1807,27 +1807,27 @@ compatible with the `resource_fd` resource type.
```cpp
namespace sycl::ext::oneapi::experimental {

struct interop_semaphore_handle {
struct external_semaphore {
using raw_handle_type = /* Implementation defined */;
raw_handle_type raw_handle;
};

template <typename ResourceType>
interop_semaphore_handle import_external_semaphore(
external_semaphore import_external_semaphore(
external_semaphore_descriptor<ResourceType>
externalSemaphoreDescriptor,
const sycl::device &syclDevice,
const sycl::context &syclContext);

template <typename ResourceType>
interop_semaphore_handle import_external_semaphore(
external_semaphore import_external_semaphore(
external_semaphore_descriptor<ResourceType>
externalSemaphoreDescriptor,
const sycl::queue &syclQueue);
}
```

The resulting `interop_semaphore_handle` can then be used in a SYCL command
The resulting `external_semaphore` can then be used in a SYCL command
group, to either wait until the semaphore signalled, or signal the semaphore.

If the type of semaphore imported supports setting the state of discrete
Expand All @@ -1843,77 +1843,77 @@ namespace sycl {
class handler {
public:
void ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle);
ext::oneapi::experimental::external_semaphore
external_semaphore);

void ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t wait_value);

void ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle);
ext::oneapi::experimental::external_semaphore
external_semaphore);

void ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t signal_value);
};

class queue {
public:
event ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle);
ext::oneapi::experimental::external_semaphore
external_semaphore);
event ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
event DepEvent);
event ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
const std::vector<event> &DepEvents);

event ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t wait_value);
event ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t wait_value,
event DepEvent);
event ext_oneapi_wait_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t wait_value,
const std::vector<event> &DepEvents);

event ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle);
ext::oneapi::experimental::external_semaphore
external_semaphore);
event ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
event DepEvent);
event ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
const std::vector<event> &DepEvents);

event ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t signal_value);
event ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t signal_value,
event DepEvent);
event ext_oneapi_signal_external_semaphore(
ext::oneapi::experimental::interop_semaphore_handle
interop_semaphore_handle,
ext::oneapi::experimental::external_semaphore
external_semaphore,
uint64_t signal_value,
const std::vector<event> &DepEvents);
};
Expand Down Expand Up @@ -1952,11 +1952,11 @@ access the external semaphore once they are no longer required through
```cpp
namespace sycl::ext::oneapi::experimental {

void release_external_semaphore(interop_semaphore_handle semaphoreHandle,
void release_external_semaphore(external_semaphore semaphoreHandle,
const sycl::device &syclDevice,
const sycl::context &syclContext);

void release_external_semaphore(interop_semaphore_handle semaphoreHandle,
void release_external_semaphore(external_semaphore semaphoreHandle,
const sycl::queue &syclQueue);

}
Expand Down Expand Up @@ -2547,34 +2547,34 @@ sycl::ext::oneapi::experimental::external_semaphore_descriptor<

try {
// Extension: import external semaphores
sycl::ext::oneapi::experimental::interop_semaphore_handle
wait_interop_semaphore_handle =
sycl::ext::oneapi::experimental::external_semaphore
wait_external_semaphore =
sycl::ext::oneapi::experimental::import_external_semaphore(
wait_external_semaphore_desc, queue);

sycl::ext::oneapi::experimental::interop_semaphore_handle
done_interop_semaphore_handle =
sycl::ext::oneapi::experimental::external_semaphore
done_external_semaphore =
sycl::ext::oneapi::experimental::import_external_semaphore(
done_external_semaphore_desc, queue);

// Extension: import external memory from descriptors
sycl::ext::oneapi::experimental::interop_mem_handle
input_interop_mem_handle =
sycl::ext::oneapi::experimental::external_mem
input_external_mem =
sycl::ext::oneapi::experimental::import_external_memory(
input_ext_mem_desc, queue);

sycl::ext::oneapi::experimental::interop_mem_handle
output_interop_mem_handle =
sycl::ext::oneapi::experimental::external_mem
output_external_mem =
sycl::ext::oneapi::experimental::import_external_memory(
output_ext_mem_desc, queue);

// Extension: map imported external memory to image memory
sycl::ext::oneapi::experimental::image_mem_handle input_mapped_mem_handle =
sycl::ext::oneapi::experimental::map_external_image_memory(
input_interop_mem_handle, desc, queue);
input_external_mem, desc, queue);
sycl::ext::oneapi::experimental::image_mem_handle output_mapped_mem_handle =
sycl::ext::oneapi::experimental::map_external_image_memory(
output_interop_mem_handle, desc, queue);
output_external_mem, desc, queue);

// Extension: create images from mapped memory and return the handles
sycl::ext::oneapi::experimental::unsampled_image_handle img_input =
Expand All @@ -2585,7 +2585,7 @@ try {
output_mapped_mem_handle, desc, queue);

// Extension: wait for imported semaphore
q.ext_oneapi_wait_external_semaphore(wait_interop_semaphore_handle)
q.ext_oneapi_wait_external_semaphore(wait_external_semaphore)

// Submit our kernel that depends on imported "wait_semaphore_file_descriptor"
q.submit([&](sycl::handler &cgh) {
Expand All @@ -2610,7 +2610,7 @@ try {
});

// Extension: signal imported semaphore
q.ext_oneapi_signal_external_semaphore(done_interop_semaphore_handle)
q.ext_oneapi_signal_external_semaphore(done_external_semaphore)

// The external API can now use the semaphore it exported to
// "done_semaphore_file_descriptor" to schedule its own command submissions
Expand All @@ -2619,13 +2619,13 @@ try {

// Extension: destroy all external resources
sycl::ext::oneapi::experimental::release_external_memory(
input_interop_mem_handle, queue);
input_external_mem, queue);
sycl::ext::oneapi::experimental::release_external_memory(
output_interop_mem_handle, queue);
output_external_mem, queue);
sycl::ext::oneapi::experimental::release_external_semaphore(
wait_interop_semaphore_handle, queue);
wait_external_semaphore, queue);
sycl::ext::oneapi::experimental::release_external_semaphore(
done_interop_semaphore_handle, queue);
done_external_semaphore, queue);
sycl::ext::oneapi::experimental::destroy_image_handle(img_input, queue);
sycl::ext::oneapi::experimental::destroy_image_handle(img_output, queue);
} catch (sycl::exception e) {
Expand Down Expand Up @@ -2859,4 +2859,11 @@ These features still need to be handled:
3D USM images as they are not supported on any platform.
- Refine the description of `ext_oneapi_bindless_images` aspect
to indicate support for bindless image APIs.
|5.16|2024-07-24| - Renamed interop aspect queries, handles, semaphore wait and
signal functions, by replacing `interop` with `external` for
consistency with other interop related structs/funcs and
3rd party interop API naming.
- Removed `handle` keyword from `interop_xxx_handle` to
clear up possible confusion between 3rd party interop
handles and the imported `interop_xxx_handle`.
|======================
Loading
Loading