-
Notifications
You must be signed in to change notification settings - Fork 844
[SYCL] Reusable events extension implementation #22399
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
Open
slawekptak
wants to merge
44
commits into
intel:sycl
Choose a base branch
from
slawekptak:ext_reusable_events_impl
base: sycl
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
44 commits
Select commit
Hold shift + click to select a range
f6c3117
Reusable events - initial commit
slawekptak fe05fc9
Merge branch 'sycl' into ext_reusable_events_impl
slawekptak 11fa455
Merge branch 'sycl' into ext_reusable_events_impl
slawekptak c033674
Update the API to match the spec.
slawekptak 6a254b3
Reusable events argument for scheduler and scheduler-bypass,
slawekptak 55d5f29
Merge branch 'sycl' into ext_reusable_events_impl
slawekptak 909e561
make_event draft
slawekptak 49f3ca8
Add a context check for reusable events support, add enable_profiling
slawekptak ed9edba
Remove unused function.
slawekptak 921c547
Add E2E tests.
slawekptak 80c629f
Add unit tests.
slawekptak 8a30d61
Make the signal event command not supported with graphs.
slawekptak de47e2e
Avoid creating an event for enqueue_wait_event(s) functions,
slawekptak b35b78e
Don't create an event in UR if not needed for barriers.
slawekptak 7fdcaf8
Merge branch 'sycl' into ext_reusable_events_impl
slawekptak 0df6399
Update urEventCreateExp call.
slawekptak ed97c5f
Lazy initialization of the UR event, exception for the scheduler
slawekptak 0541baa
Merge branch 'sycl' into ext_reusable_events_impl
slawekptak 83092c4
Remove reusable event from the scheduler.
slawekptak c0d92b4
A fallback path when reusable events not supported, minor changes.
slawekptak d5f44b2
Unit test variable naming, function comments.
slawekptak 8a96a13
Add a check if all devices in the context support per-event profiling.
slawekptak 0eaa035
Merge branch 'sycl' into ext_reusable_events_impl
slawekptak a8e9376
Update profiling unit tests, enable device profiling support query.
slawekptak 87fd84a
Inline functions fix.
slawekptak 1f4375b
Update Linux symbols.
slawekptak 8768588
Update Windows symbols.
slawekptak db0c197
Update kernel_timing test.
slawekptak 569070c
Add a new device aspect related to per-event profiling.
slawekptak 7d22a48
Lambda fix.
slawekptak cf5cd5a
Disable kernel_timing test, minor changes.
slawekptak 97aa1b7
Update exception message in the test.
slawekptak 77d76c9
Address review comments.
slawekptak 953b99a
Update Linux symbols.
slawekptak 4b2ca49
Update Windows symbols.
slawekptak d368c1c
Merge branch 'sycl' into ext_reusable_events_impl
slawekptak a00ee6a
Remove XFAIL from kernel_timing test.
slawekptak 85b1574
Add a lock for the new context functions.
slawekptak 4371bb8
Define the feature macro.
slawekptak d265ea9
Remove the unit test related to a host task. The test fails, but
slawekptak ad73721
Remove sycl.hpp from E2E tests.
slawekptak 2760efc
Run the kernel_timing on UR V2 adapter only.
slawekptak 2efb497
Address review
againull c9e6c34
Address review
againull File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
67 changes: 67 additions & 0 deletions
67
sycl/include/sycl/ext/oneapi/experimental/reusable_events.hpp
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,67 @@ | ||
| //==------- reusable_events.hpp --- SYCL reusable events -------------------==// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #pragma once | ||
|
|
||
| #include <sycl/context.hpp> | ||
| #include <sycl/device.hpp> | ||
| #include <sycl/event.hpp> | ||
| #include <sycl/ext/oneapi/properties/properties.hpp> | ||
| #include <sycl/platform.hpp> | ||
| #include <sycl/queue.hpp> | ||
|
|
||
| namespace sycl { | ||
| inline namespace _V1 { | ||
| namespace ext::oneapi::experimental { | ||
|
|
||
| struct enable_profiling_key | ||
| : detail::compile_time_property_key<detail::PropKind::EnableProfiling> { | ||
| using value_t = property_value<enable_profiling_key>; | ||
| }; | ||
|
|
||
| inline constexpr enable_profiling_key::value_t enable_profiling; | ||
|
|
||
| namespace detail { | ||
|
|
||
| enum make_event_flags : uint32_t { make_event_flag_enable_profiling = 1u }; | ||
|
|
||
| __SYCL_EXPORT sycl::event make_event(const sycl::context &ctxt, uint32_t Flags); | ||
|
|
||
| template <typename PropertyListT> uint32_t getMakeEventFlags() { | ||
| uint32_t Flags = 0; | ||
| if constexpr (PropertyListT::template has_property<enable_profiling_key>()) | ||
| Flags |= make_event_flag_enable_profiling; | ||
| return Flags; | ||
| } | ||
| } // namespace detail | ||
|
|
||
| template <typename PropertyListT = empty_properties_t> | ||
| inline sycl::event make_event(const sycl::context &ctxt, | ||
| PropertyListT props = {}) { | ||
| static_assert(is_property_list_v<PropertyListT>, | ||
| "Props must be a sycl::ext::oneapi::experimental::properties"); | ||
| (void)props; | ||
|
|
||
| return detail::make_event(ctxt, detail::getMakeEventFlags<PropertyListT>()); | ||
| } | ||
|
|
||
| template <typename PropertyListT = empty_properties_t> | ||
| inline sycl::event make_event(PropertyListT props = {}) { | ||
| sycl::device Dev; | ||
| sycl::context Ctx = Dev.get_platform().khr_get_default_context(); | ||
| return make_event(Ctx, props); | ||
| } | ||
|
|
||
| __SYCL_EXPORT void enqueue_wait_event(sycl::queue q, const event &evt); | ||
| __SYCL_EXPORT void enqueue_wait_events(sycl::queue q, | ||
| const std::vector<event> &evts); | ||
| __SYCL_EXPORT void enqueue_signal_event(sycl::queue q, event &evt); | ||
|
|
||
| } // namespace ext::oneapi::experimental | ||
| } // namespace _V1 | ||
| } // namespace sycl |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.